Syncing CRDT → FwData throws and wedges the whole project sync if a complex form entry was deleted in CRDT while one of its components still exists.
SyncObjectException: Failed to sync complex forms and components of entry 7854f5ab-…
---> KeyNotFoundException: Key 99fd574d-… not found in identity map
at FwDataMiniLcmApi.DeleteComplexFormComponent FwDataMiniLcmApi.cs:1096
at EntrySync.ComplexFormsDiffApi.Remove EntrySync.cs:235
Cause: the FwData-write pass deletes the parent complex form in phase 1 (it's gone in CRDT), which cascades away its relationship. Phase 2 then diffs the surviving component against the stale before-snapshot, sees the edge gone, and calls DeleteComplexFormComponent — which resolves the parent via GetObject and throws because phase 1 already deleted it. Not a conflict; the edge is simply already gone.
Fix: make DeleteComplexFormComponent tolerate a missing parent (TryGetObject + return), mirroring the guard RemoveComplexFormComponent already has for the component side. CRDT already no-ops here. #2367 covered the create/update/move paths but not this delete cascade.
Alternatively, we could reread all the entries so the diff reflects cascaded deletes.
Repro: project rmunn-thai-food-test; regression test FwDataEntrySyncTests.SyncFull_RemovingComplexFormWhoseParentWasDeleted_DoesNotThrow (no infra needed). Fix + test on branch debug-thai-sync-error.
Syncing CRDT → FwData throws and wedges the whole project sync if a complex form entry was deleted in CRDT while one of its components still exists.
Cause: the FwData-write pass deletes the parent complex form in phase 1 (it's gone in CRDT), which cascades away its relationship. Phase 2 then diffs the surviving component against the stale before-snapshot, sees the edge gone, and calls
DeleteComplexFormComponent— which resolves the parent viaGetObjectand throws because phase 1 already deleted it. Not a conflict; the edge is simply already gone.Fix: make
DeleteComplexFormComponenttolerate a missing parent (TryGetObject+ return), mirroring the guardRemoveComplexFormComponentalready has for the component side. CRDT already no-ops here. #2367 covered the create/update/move paths but not this delete cascade.Alternatively, we could reread all the entries so the diff reflects cascaded deletes.
Repro: project
rmunn-thai-food-test; regression testFwDataEntrySyncTests.SyncFull_RemovingComplexFormWhoseParentWasDeleted_DoesNotThrow(no infra needed). Fix + test on branchdebug-thai-sync-error.