Skip to content

Send a never-synced project's missing entries only to an empty FieldWorks - #365

Merged
rmunn merged 2 commits into
developfrom
bugfix/never-synced-empty-fieldworks
Nov 12, 2026
Merged

rmunn merged 2 commits into
developfrom
bugfix/never-synced-empty-fieldworks

Conversation

@rmunn

@rmunn rmunn commented Nov 12, 2026

Copy link
Copy Markdown
Collaborator

#361 made LfMerge send every entry a never-synced project's FieldWorks lacks, so that an LF project's first Send/Receive -- as when one is migrated -- would not lose the entries a LIFT import into LF left without user references. But it did that for every never-synced project, and the ones whose FieldWorks already has entries were cloned from it: the entries it lacks were since deleted in FLEx, or dropped when its repository was begun afresh. Their next sync would bring those entries back, undoing what #362 was for. Three never-synced projects on the live server are like that, with 664 such entries between them.

So the missing entries are now sent only when FieldWorks had no entries at all before the conversion began, which is how a migration's new LexBox project starts. Every other never-synced project is back to how #362 left it.

…orks

#361 made LfMerge send every entry a never-synced project's FieldWorks lacks,
so that an LF project's first Send/Receive -- as when one is migrated -- would
not lose the entries a LIFT import into LF left without user references. But
it did that for every never-synced project, and the ones whose FieldWorks
already has entries were cloned from it: the entries it lacks were since
deleted in FLEx, or dropped when its repository was begun afresh. Their next
sync would bring those entries back, undoing what #362 was for. Three
never-synced projects on the live server are like that, with 664 such entries
between them.

So the missing entries are now sent only when FieldWorks had no entries at all
before the conversion began, which is how a migration's new LexBox project
starts. Every other never-synced project is back to how #362 left it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@rmunn rmunn self-assigned this Nov 12, 2026
@github-actions

github-actions Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Test Results

    2 files  ±0    25 suites  ±0   4m 50s ⏱️ +6s
427 tests +1  405 ✔️ +1  22 💤 ±0  0 ❌ ±0 
430 runs  +1  408 ✔️ +1  22 💤 ±0  0 ❌ ±0 

Results for commit fd79190. ± Comparison against base commit c731109.

This pull request removes 1 and adds 2 tests. Note that renamed tests count towards both.
Action_NeverSyncedProjectWithEntryImportedIntoLf_SendsItToFieldWorks
Action_NeverSyncedProjectIntoEmptyFieldWorks_SendsEntriesImportedIntoLf
Action_NeverSyncedProjectWhoseFieldWorksHasEntries_DoesNotRecreateEntryDeletedInFieldWorks

♻️ This comment has been updated with latest results.

In a never-synced project whose FieldWorks has entries, an LF entry with no
user references that FieldWorks lacks is taken to have been deleted in FLEx
since the initial clone, and the transfer back to Mongo marks it deleted. The
data cannot check that: an entry imported into LF from LIFT after the clone
looks just the same, and would be marked deleted too.

That is deliberate, but it should not pass unnoticed. Each such entry is now
logged by GUID and name as it is left out, so that one which turns out to be
LF's own can be found and restored -- marking it deleted leaves it in Mongo.
The comment there now says this is an assumption, and names the case it gets
wrong. After a sync nothing is logged: an entry FieldWorks lacks then was
certainly deleted in FLEx.

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

rmunn commented Nov 12, 2026

Copy link
Copy Markdown
Collaborator Author

Devin's concerns could not be reproduced with real data (it would require a LIFT import on LF and someone adding entries to FieldWorks and doing a FW S/R before LF ever did a Send/Receive, which no project has ever done). But I added some logging to make sure that if such a convoluted process did happen, there was an explanation for why the LF entries were suddenly marked as deleted. (Reversing the process would simply involve setting isDeleted = false in Mongo so there's no risk of data loss either).

So since the only concern Devin raised is something that can't happen, I'm merging now so that we have an actual correct algorithm in develop.

@rmunn
rmunn merged commit 53a89f9 into develop Nov 12, 2026
3 checks passed
@rmunn
rmunn deleted the bugfix/never-synced-empty-fieldworks branch November 12, 2026 10:11
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.

1 participant