Repository navigation
Conversation
One Send/Receive splits and unifies the project in one process, and each pass added the project's custom fields to the shared MetadataCache again. The cache collected duplicates, and since lookups return the first match, a custom field whose type changed in the pull kept its old type. Post-merge validation then rejected data of the new type. All custom-field adds now go through one path that replaces an earlier custom definition of the same name and never touches model properties. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Any caller that adds a custom property directly now gets replace semantics too, so a future call site can't reintroduce duplicates. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 task done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes an issue Claude found which would result in replicating custom fields in FdoClassInfo. This also resolves a potential stale cache when a custom field type changes, I understand this is not permitted in FLEx, however 2 users could create the same field (unlikely), or a user could just delete a field, and create the same one again with a different type (likely), not sure how this would break if someone actually did it, but it's now a little less broken.
I'm not sure I love the approach taken in
CustomPropertyCacheTeststo build the fwdata file, I started working on some simple e2e split/unify tests and those are using the same approach. Do we keep doing this? or do we build up the fwdata file some other way for these tests? Maybe via LCM?AI summary
Summary
MetadataCacheis a process-wide singleton. In one Send/Receive the splitter adds the project's custom fields to it, and the unifier (plus any re-split) adds them again. Each add was appended, andGetPropertyreturns the first match, so:All custom-field adds now go through one path that replaces an earlier custom definition of the same name:
Evidence
New tests in
CustomPropertyCacheTestssplit a small generated .fwdata with custom fieldLexEntry.Rank(Integer), then unify it.Before:
The validation failure is the downstream symptom: after the field becomes String,
CmObjectValidator(used by Chorus post-merge validation) rejects correct String data because the cache still says Integer.After: LibFLExBridge-ChorusPluginTests: 523 passed, 0 failed. FLEx-ChorusPluginTests: 6 passed, 0 failed.
Merge Danger
Door: two-way
Cache-only change, no on-disk format change; a revert restores the old behavior.
Blast Radius: narrow
Every caller that adds a custom property to the cache (splitter, unifier, FwdataNester, merge handlers, RepositoryUtility) now gets replace instead of append. One subtle difference: the MergeOrder path used to skip a field whose name matched any property, including inherited model properties. Now it checks only the class's own properties, so a custom field named like a superclass model property would be added alongside it. FLEx shouldn't produce such a name.
Test plan
dotnet test src/LibFLExBridge-ChorusPluginTests/LibFLExBridge-ChorusPluginTests.csproj -c Release "-p:SolutionDir=<repo root>\": 523 passed. WithoutSolutionDir, the Mercurial package doesn't unpack when building a single project and 12 unrelated Mercurial tests fail.FLEx-ChorusPluginTests: 6 passed.🤖 Generated with Claude Code
This change is