Repository navigation
fix(core-sync): a secret a landing takes out is marked in the state file and saves wait for it, and a store in refill keeps what stays on the device - #4820
Merged
Conversation
…hold saves across it, and keep refill repairs off local-only records
…re an envelope lands, and a destination changed here holds the record
…-back envelope reads as its base, and a refill refusal holds its envelopes
…cord, and a refill refusal no longer holds its envelopes
…secrets store nothing, and the secret follows its record
This was referenced Dec 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Second follow-up to #4815, from the Codex review and adversarial passes on #4816.
parent_landingmarks a secret in the state file before it takes it out: a held row beside the envelope's id (<envelope id>#landing) that keeps where the record pointed, which no pull offers again and which leaves an envelope held for its record as it is. It marks only what goes back: a secret the store holds, or a move back to where the envelope was sealed for. A secret the person removed stays removed.parent_landedputs the secret back where the record points then: the value taken out, else the envelope's, where the record pointed when it was taken out or where the envelope was sealed for. Then it clears the mark. A mark stays while its envelope does not open or its record cannot be read.EnvelopeAdapter::recordsandapplysettle any mark a crash, a stop or a failed put-back left, so it is settled before an envelope lands.RecordAdapter::landing_hold: the pull holds the app's save lock from the first secret out to the last one back.parent_landingandparent_landedtake no hold of their own.parent_landedruns for every Put, the held ones and a failed or stopped write too. Its error logs and the next pass settles the mark, instead of stopping the pass.parent_landingandparent_landedread only the envelope bases they need.RefusedInRefill, which the push skips, with the served copy for the next pull. Before, the hold went under the wire id, the push sent the restored values, and no pull retried it.destinations.rs:a_pull_asks_the_secrets_store_before_the_record_lands_and_a_refusal_holds_the_recordexpectsparent_landedfor the held record too.a_move_the_records_store_refuses_gets_its_password_back_and_its_envelope_staysno longer readsrecords()between the hooks, which the save lock rules out. The held-back checks ina_pulled_destination_change_takes_the_password_out_first_holds_its_envelope_back_and_a_move_back_lands_itanda_move_back_the_records_store_refuses_lands_no_password_where_the_record_still_pointsexpect the base copy, not an unreadable id.Test plan
Each fails on main and passes here:
tests/engine/sealed.rs:a_restored_store_keeps_a_record_it_keeps_to_itself_whatever_copy_the_server_serves,a_restored_store_that_refuses_the_floor_s_copy_holds_the_record_sends_nothing_restored_and_takes_it_later,a_floor_s_copy_a_restored_store_refused_for_a_record_no_snapshot_served_goes_again_until_it_lands.tests/engine/destinations.rs:a_crash_before_the_record_lands_neither_deletes_the_envelope_nor_loses_the_password,a_crash_after_a_move_back_lands_puts_the_password_back_on_the_next_pass,a_password_changed_here_and_not_sent_holds_the_record_and_stays,a_crash_puts_the_password_back_where_a_destination_changed_here_points,a_newer_envelope_for_where_a_moved_record_points_lands_while_the_old_one_is_held_back,a_later_landing_that_takes_nothing_keeps_where_an_open_landing_found_the_record,with_password_sync_turned_off_here_a_pulled_destination_lands_and_the_secret_follows_it,with_password_sync_off_by_policy_a_pulled_destination_lands_and_the_secret_follows_it,a_landing_keeps_an_envelope_already_held_for_its_record,a_crash_beside_an_envelope_held_for_the_record_puts_the_password_back_before_that_envelope_lands,a_landing_mark_stays_while_its_record_cannot_be_read.a_password_the_person_removed_stays_removed_when_the_move_does_not_landanda_restored_store_pointing_elsewhere_takes_the_synced_destination_with_its_passwordguard the mark rule.Runs:
cargo nextestfortablepro-sync,tablepro-sync-testingandtablepro-sync-host: 1402 passed.tablepro-ffi --lib: 302 passed.cargo clippy --all-targets -D warningsfor keys, records, sync, sync-testing, sync-host and ffi: clean.codex review --base origin/main: no findings.