Repository navigation
Conversation
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
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
A restore with the recovery key now asks which of the group's devices the user still has. None is ticked by default. The rest are signed out before this device seals anything new, as flow-sync #96 specifies.
restoreandrecoveryas before. The chosen devices are saved with the group record (migration 0039).Session::openreads every log without saving anything, removes every current device not on the list, re-reads the roster, and only then clears the list. The list of devices to remove is worked out at that moment. Cuts come from the unsaved read, because saved positions are empty on a restored device. A log that stops at an object the store doesn't have, or one that doesn't verify, ends there, and the read goes on with the other logs. A read that hits this device's own limits removes nobody yet: it keeps its place in the group row (migration 0040), apart from the saved streams, goes on at the next sync and removes once it reaches the end. It doesn't try while the store is out of reach, and a stop anywhere resumes on the next open.Session::may_sealguards batches, acks, profile records, snapshot blobs and manifests, store logins and live messages. LAN sessions stay up, since the spec names objects and live messages.LinkedStatusonce, and the recovery words are marked unsaved before the roster re-read.Follows flow-sync #96. Flow-Tube/Flow #1831 is the Android side.
Related issue
None.
Change type
Validation
Run on macOS arm64.
pnpm test: 1362 passed (not rerun for the last commit, which changes no frontend file)pnpm build: built (not rerun for the last commit)cargo fmt --checkinsrc-tauri: exit 0cargo clippy --all-targets --all-featuresinsrc-tauri: exit 0, no warnings in the sync files this adds or was checked oncargo test --no-fail-fastinsrc-tauri, without--all-features: 1313 passed, 0 failed, 9 ignoredNew tests in
tests/sync2_restore_removal.rs(27) andtests/sync2_hybrid.rs(1). Checked by breaking the code on purpose, one change at a time:The check for an unreachable store isn't separated by these: with it removed, the append is refused by the same outage in the test.
Risk and compatibility
Adds migrations
0039_sync2_restore_kept.sqland0040_sync2_restore_read.sql.A restore now signs out unticked devices. They can be linked again.
Other devices see an ordinary
remove, so no format changes.Desktop and Android have not been run against each other on this flow.
A store whose list is over the read limit can hold a restore pending, sealing nothing. When that list is too long and a log has nothing readable yet, the restore stays pending with an error rather than end that log with no cut, since the log may only start later.
After such a restore finishes, the first normal read on that store still fails, as it does for any device starting there. This PR doesn't change that limit.
An object listed ahead of its predecessor on an earlier page isn't read again once the read has passed that page, so that log ends at the predecessor.
No new secrets, private data, telemetry, or broad Tauri permissions were introduced.
User-facing documentation was updated where needed. (
docs/recovery.mdin flow-sync fix(ui): keep image fallbacks when a load fails instantly #96)Dependency and lockfile changes are intentional and limited to this PR.
Breaking changes and upgrade steps are clearly documented.