Skip to content

Reset MetadataCache on each LfMergeBridge call - #431

Closed
myieye wants to merge 3 commits into
developfrom
reset-metadata-cache-per-call
Closed

myieye wants to merge 3 commits into
developfrom
reset-metadata-cache-per-call

Conversation

@myieye

@myieye myieye commented Nov 19, 2026 •

Copy link
Copy Markdown

MetadataCache is a process-wide static that keeps the first project's custom field types.
Each LfMergeBridge entry point now starts with a fresh cache.

Lexbox runs LfMerge for multiple projects in the same process (one at a time). So, they currently share custom fields.
E.g. project whose LexEntry.Plural is a single-WS String failed Send/Receive validation (Invalid MultiUnicode 'Plural' ... Has non-AUni child element) after another project defined Plural as MultiUnicode.

Calls in one process must not overlap; they already couldn't safely share the cache.


This change is Reviewable

MetadataCache is a process-wide static holding one project's model version
and custom field types. A host that runs LfMergeBridge for many projects in
one process (LexBox's FwHeadless) validated one project's custom fields
against another project's types, so Send/Receive failed validation and
rolled back.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Test Results

559 tests  +3   559 ✅ +3   3m 51s ⏱️ +6s
  6 suites ±0     0 💤 ±0 
  6 files   ±0     0 ❌ ±0 

Results for commit f9fc9ea. ± Comparison against base commit c51e79b.

♻️ This comment has been updated with latest results.

Execute now resets before its argument checks, so a null action type
exercises the reset without depending on Mercurial being installed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@myieye myieye changed the title [claude] Reset MetadataCache on each LfMergeBridge call Reset MetadataCache on each LfMergeBridge call Nov 19, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@myieye
myieye marked this pull request as ready for review November 19, 2026 14:11
@hahn-kev

Copy link
Copy Markdown
Contributor

Oof, this is rough. This works if you only run these methods one at a time, if you run 1 and start another then the second wipes out the cache used by the first. It also occurs to me, if we're resetting a cache on each call then is it really a cache?

@myieye

myieye commented Nov 20, 2026

Copy link
Copy Markdown
Author

[Claude, autonomous]

Closing in favor of Kevin's upcoming fix, which replaces the global MetadataCache with a per-project cache so parallel syncs in one process work. Until it lands, Lexbox clears the cache before each Send/Receive (sillsdev/languageforge-lexbox#3010).

@myieye myieye closed this Nov 20, 2026
myieye added a commit to sillsdev/languageforge-lexbox that referenced this pull request Nov 20, 2026
…ive (#3010)

FLEx Bridge's MetadataCache is a process-wide static that keeps the first
project's custom field types, so FwHeadless validated a project's custom
fields against another project's types and Chorus rolled back the
Send/Receive. Clear it by reflection until sillsdev/flexbridge#431 ships.
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.

2 participants