Skip to content

fix(core-sync): a secret a landing took out stays marked until its record points there again - #4840

Merged
datlechin merged 1 commit into
mainfrom
fix/core-sync-landing-mark-outlives-landing
Dec 2, 2026
Merged

datlechin merged 1 commit into
mainfrom
fix/core-sync-landing-mark-outlives-landing

Conversation

@datlechin

Copy link
Copy Markdown
Member

Summary

Closes what #4834 left open (core ADR 0114, A pulled destination does not take a stored secret): a synced password deleted on every device.

  • A pull that moves a record's destination with no envelope for the new one takes the password out of the store. The landing's mark ended once the record landed. A record that then pointed back where the envelope was sealed for without a pull found the store empty with nothing to say why, and the push sent the envelope's deletion. Two ways:
    • the person edits the destination back here;
    • the library is restored from a backup taken there after another device moved it back, and the refill finds the store's copy equal to the server's, so no landing runs.
  • EnvelopeAdapter: a mark for a secret the landing took out now stays after the record lands elsewhere (Settled::Out), with where the record pointed and, new, the envelope copy the landing found (under).
    • While it stays, records reads the envelope as held back, never as a removal.
    • The next records or apply after the record points there again puts the secret back from that copy and ends the mark.
    • A mark ends with nothing put back once the store holds the secret again, the envelope's base is gone or another copy (a newer one landed, or a pull deleted it), or the record is gone. So a removal after that still goes up.
    • A move back that took nothing out keeps no mark, as before. A mark an earlier build wrote has no under and settles as before.
  • Putting it back runs whatever the categories: it restores the value the landing took out from the copy it found, never a copy pulled since.
  • Status: landing marks are left out of the held count and held_records.
  • New core ADR 0117, amending 0114: the rule above, its consequences and tests. 0114's Status line and the index rows name it.
  • No change to the Mac or Windows hosts or the FFI API.

Test plan

  • tests/engine/destinations.rs, end to end through the engine and the fake server. Each fails on main and passes here:
    • a_destination_edited_back_here_after_a_pulled_move_gets_its_password_back_and_keeps_its_envelope, which also checks that the mark is neither counted nor listed as held;
    • a_restore_equal_to_the_server_s_copy_puts_back_the_password_a_pulled_move_took_out;
    • a_password_the_person_removes_after_it_came_back_deletes_its_envelope;
    • with_ssh_profiles_off_a_password_a_pulled_move_took_out_goes_back_when_the_profile_points_there_again, which also checks that nothing goes up while they are off.
  • Pass on main and here, guarding that a removal still goes up after a newer copy landed (the round 2 security finding on fix(core-sync): an envelope's floor moves when the server takes the copy, a restored record's missing secret is no removal, and secrets follow their record's category #4834's first attempt):
    • a_password_another_device_sent_for_the_new_destination_and_removed_here_deletes_its_envelope;
    • a_password_typed_here_for_the_new_destination_and_removed_deletes_its_envelope.
  • verify.sh --platform windows --jobs 4 core on the final tree: PASS for tablepro-sync (1324), tablepro-sync-testing (105), tablepro-sync-host (16), tablepro-ffi (555), tablepro-keys (90) and tablepro-records (131).
  • cargo clippy --locked --all-targets -- -D warnings for the same six crates: clean.
  • Codex, codex review --base origin/main and a security pass with codex exec -s read-only: no findings in either.

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