Skip to content

feat(core-sync): only a team's changes wait for approval, and rows older builds left settle - #4812

Merged
datlechin merged 3 commits into
mainfrom
core-approvals-team-only
Dec 1, 2026
Merged

datlechin merged 3 commits into
mainfrom
core-approvals-team-only

Conversation

@datlechin

Copy link
Copy Markdown
Member

Summary

Lane L4 of core ADR 0114, Approvals.

  • adapters/fields.rs, Rule::of: an approval-required member, and a member no schema or registry names, waits only in a team scope. The personal scope, on TablePro Sync and on iCloud, takes a pulled change on pull. Device-only and dropped members still stay.
  • adapters/approval.rs, Queue::settle_personal, run at the start of each pass, for the personal rows a build before 0114 left:
    • iCloud (Earlier::Land): each value that waited lands, as Approve does; each record held whole lands whole; refusals go, so the kept value goes up as the person's edit. Each write lands on a store read just before it.
    • TablePro Sync (Earlier::Drop): the approval and held-whole rows go and nothing lands. A held-whole record's base goes with its row, so the diff sends no deletion of it.
    • A record whose store cannot be read, or refuses the write, keeps its rows for a later pass. Leftover prior/ mirror items go.
  • cloudkit/legacy/export.rs: the downgrade mirror drops its approval readings: no prior/ copy, no waiting value held by id, no type left unread. A held-whole leftover that has not landed yet goes to the previous stable as a change held by id. The fetch no longer writes prior/ copies.
  • Merge order: alone on main, a TablePro Sync personal record takes a plaintext pulled change with no approval. Land it with L3 (sealing) in the same release.
  • sync-host/src/engines_tests.rs: cargo fmt of a line main left unformatted.

Tests changed on purpose:

  • tests/engine/approvals.rs and the approval cases of tests/engine/rules.rs run on Team Library connections (DeviceBuilder::team_library). The 0107 settings take-up cases become team record cases. E2E F14's case now takes the person's connections with nothing to review.
  • tests/cloudkit/approval.rs rewritten: a pulled host applies on pull, a new connection lands whole, rows an older build left settle, an unreadable copy keeps its rows for a later pass.
  • tests/cloudkit/legacy/mirror.rs: the previous stable gets the applied value; leftovers that cannot settle hold nothing back from it.
  • tests/cloudkit/{pending,pull,held,legacy/import}.rs, tests/engine/{moves,library}.rs, ffi/src/sync/secrets_tests.rs: the same scenarios with nothing waiting.
  • tests/engine/fixtures.rs reads the memory store as a real store holds it: a newer build's member in the personal scope now reaches the store write, which a real store drops.
  • sync-host/src/service_tests.rs counts team rows only.
  • Deleted, the case no longer exists: teams_only::a_personal_approval_rests_unlisted_and_undecided_while_teams_only, rules::a_policy_revival_sends_the_device_s_own_value_of_a_member_still_waiting (no team policy toggle), cloudkit pending::a_pulled_port_change_keeps_its_waiting_row_across_a_crash_after_the_store_write (an existing crash case once nothing waits), and the cloudkit cases for a host set while one waits, a deletion leaving nothing to approve, and a held-whole record whose next copy fails to read.

Test plan

  • New, fails on main: engine approvals::personal_rows_an_earlier_build_left_go_and_nothing_they_held_lands (also fails without the base deletion: the server record is deleted), engine approvals::a_personal_host_change_lands_while_a_team_host_change_waits_in_the_same_pass, cloudkit approval::rows_an_earlier_build_left_land_what_waited_and_send_what_was_refused.
  • cargo nextest run -p tablepro-sync: 1224 passed.
  • cargo nextest run -p tablepro-sync-host -p tablepro-records and the tablepro-ffi sync tests: 220 passed.
  • cargo clippy -p tablepro-sync -p tablepro-sync-host -p tablepro-ffi --all-targets -- -D warnings clean; cargo fmt --all -- --check clean.
  • codex review --base origin/main: round 1 raised the merge order (above), a stale store read and a lost downgrade marker, both fixed in the second commit.

…der builds left settle

ADR 0114, Approvals. iCloud lands what an older build kept waiting; a TablePro Sync file drops it, with the base of a record held whole so the diff sends no deletion.
@datlechin datlechin added the backport release/0.89 Merged into main; pick onto release/0.89 label Dec 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport release/0.89 Merged into main; pick onto release/0.89

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant