Repository navigation
Prevent large-vault full-scan RPCs from timing out with outcome_unknown - #201
Merged
Merged
Conversation
callumalpass
marked this pull request as ready for review
November 26, 2026 21:56
callumalpass
enabled auto-merge (squash)
November 26, 2026 21:56
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.
Fixes large vaults (~17,000 files) failing with
Sync needs attention — Sync stopped. Something went wrong (outcome_unknown). Your files here are untouched.during full-vault scans.Root cause
NativeSync.call()enforced a fixed 180-second wall-clock timeout across the entire RPC, even whileall,filesAll,resourcesAll, andatwere actively streaming pages back from the SDK replica, and reported every timeout (including read-only scans) asoutcome_unknown.query_budget_exceeded,all()previously restarted the entire full-vault scan from page 1 with a halved page size for every page instead of shrinking only the oversized page.resolveDefinition()calledremoteAll()(scanning every record and file in the vault) before pushing a single definition update.Changes
src/sync/native/page.ts,src/sync/native/protocol.ts: Emit per-pageprogressheartbeats fromall,filesAll,resourcesAll, andat; shrink only the oversized page onquery_budget_exceeded(falling back to a smaller initial limit only if the runtime refuses a smaller limit on an existing cursor, and failing cleanly if even a single-record page exceeds the budget).src/sync/native/plugin.ts: Reset the per-call inactivity timer onprogressmessages; classify timed-out read-only RPCs astimeout(friendly message, neveroutcome_unknown) while keepingoutcome_unknownfor write RPCs.src/sync/native/pass.ts: Read resources directly inresolveDefinition()before updating, without scanning all records and files first.test/native/mobile.test.mjs,test/native/sync.test.mjs: Add tests covering per-page progress heartbeats, local page shrinking and single-record budget refusal, read vs write timeout classification, andresolveDefinition()avoiding full scans.