Skip to content

fix(config-sync): merge entities absent from one side as implicit deletes - #2457

Merged
vastsa merged 2 commits into
mainfrom
fix/config-sync-remote-absent-merge
Nov 20, 2026
Merged

vastsa merged 2 commits into
mainfrom
fix/config-sync-remote-absent-merge

Conversation

@vastsa

@vastsa vastsa commented Nov 20, 2026

Copy link
Copy Markdown
Owner

Problem

Cloud sync failed permanently with remote merge state missing when an entity existed in the acknowledged base, was edited (or deleted) locally, and was entirely absent from the remote head (e.g. the remote carried an unresolved :local/:remote pair, or a device dropped the record). Retrying hit the same error.

Fix

config_sync::merge::three_way now treats an absent side as an implicit delete in the changed cases too:

  • local tombstone + remote absent → converge on delete
  • local edit + remote absent (or the mirror) → delete-versus-edit conflict for review
  • local edit + remote unresolved conflict pair → keep local edit, pass pair through

Validation

  • 4 new regression tests in merge.rs (fail on old code, pass now)
  • cargo test -p host-core config_sync 55/55, cargo fmt --check clean
  • Full host-core: 2 failures unrelated and environment-specific (tests pick up the locally installed /Applications/PI-Desktop.app bundled plugins)

…etes

A record present in the acknowledged base but missing entirely from the
remote head (or the local snapshot) while the other side edited it made
three_way() fail with "remote merge state missing". Sync then failed on
every retry with no way for the user to recover.

An absent record is already treated as an implicit delete when the other
side is unchanged. Extend that to the changed cases: a matching local
tombstone converges on delete, an edit becomes a delete-versus-edit
conflict for review, and an unresolved remote :local/:remote pair keeps
the local edit instead of being read as a deletion.
@vastsa
vastsa merged commit 9014c60 into main Nov 20, 2026
5 checks passed
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