Skip to content

Prevent creating objects with duplicated GUIDs#367

Merged
papeh merged 4 commits intomasterfrom
bug/prevent-dupe-guid-creation
Feb 13, 2026
Merged

Prevent creating objects with duplicated GUIDs#367
papeh merged 4 commits intomasterfrom
bug/prevent-dupe-guid-creation

Conversation

@rmunn
Copy link
Contributor

@rmunn rmunn commented Feb 12, 2026

Fixes #365.

This should not affect FW, since the FooFactory.Create(guid) method is not used in FieldWorks. FW Lite uses it, so that FW Lite can create LCM objects with GUIDs that match the GUIDs of objects that are being synchronized from other projects. And FW Lite will be changed to expect an InvalidOperationError to be thrown in case of a duplicated GUID being created, and handle the resulting merge conflict accordingly.


This change is Reviewable

@rmunn rmunn self-assigned this Feb 12, 2026
@rmunn rmunn force-pushed the bug/prevent-dupe-guid-creation branch from d493349 to 12f0af4 Compare February 12, 2026 04:39
@rmunn
Copy link
Contributor Author

rmunn commented Feb 12, 2026

Don't know why publish-test-results is failing. Will close and reopen the PR in order to kick it anew, and perhaps that will get GHA unstuck?

@rmunn rmunn closed this Feb 12, 2026
@rmunn rmunn reopened this Feb 12, 2026
@rmunn
Copy link
Contributor Author

rmunn commented Feb 12, 2026

Apparently all PRs are having issues with permission being denied to the publish-test-results step.

TryGetObject would create and populate an object, but here we only want
to check whether the GUID we're trying to use is already assigned. So
we just use the IsValidObjectId() method, which only returns a bool. We
just have to document that here, we want the method to return *false*.
@github-actions
Copy link

github-actions bot commented Feb 13, 2026

LCM Tests

    16 files  ±0      16 suites  ±0   3m 3s ⏱️ -6s
 2 858 tests +2   2 838 ✅ +2   20 💤 ±0  0 ❌ ±0 
11 380 runs  +8  11 212 ✅ +8  168 💤 ±0  0 ❌ ±0 

Results for commit 6edd151. ± Comparison against base commit 766b9ac.

♻️ This comment has been updated with latest results.

Copy link
Contributor

@myieye myieye left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added some tests and changed the exception message, because it's not scoped by class.

@papeh papeh merged commit 4e27ee6 into master Feb 13, 2026
4 of 5 checks passed
@papeh papeh deleted the bug/prevent-dupe-guid-creation branch February 13, 2026 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Objects can be created with duplicate Guids which breaks the project

3 participants