[Fix] Sync disconnect hangs and stale error status - #1108
Merged
Merged
Conversation
🦋 Changeset detectedLatest commit: 0f578a5 The changes in this PR will be included in the next version bump. This PR includes changesets to release 7 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
simolus3
reviewed
Sep 17, 2026
Manrich121
marked this pull request as ready for review
September 17, 2026 11:03
connect() hanging on an unresponsive tab
simolus3
reviewed
Sep 18, 2026
simolus3
previously approved these changes
Sep 18, 2026
simolus3
left a comment
Contributor
There was a problem hiding this comment.
Could you rebase ontop of / merge main? That contains a fix for the test action job not starting, apart from that this LGTM.
Calls into a client tab had no timeout and ignored the sync abort signal, so one unresponsive tab wedged disconnect() and every connect() behind it. Also stop recording a requested disconnect as a downloadError. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-authored-by: Simon Binder <simon@powersync.com>
Co-authored-by: Simon Binder <simon@powersync.com>
…` and wire through to `#useConnector`
simolus3
force-pushed
the
fix/shared-worker-connector-call-timeout
branch
from
September 21, 2026 10:18
358a439 to
0f578a5
Compare
simolus3
approved these changes
Sep 21, 2026
simolus3
left a comment
Contributor
There was a problem hiding this comment.
We'll need another +1 now. For context, I've added these commits to fix web reconnect tests.
I used Claude code to find the issue and implement the fix.
Chriztiaan
approved these changes
Sep 21, 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.
Problem
disconnect()waits for the sync loops to finish. A checkpoint retry waiting on an already-aborted signal or a pending shared-worker connector call could prevent it from completing, leaving subsequentconnect()calls pending.Intentional disconnects could also leave a stale
downloadErrorofDisconnect has been requestedon the sync status.Changes
uploadCrudandpostCheckpointRequest, allowing the shared worker to stop waiting when disconnected. Connector calls have no timeout;fetchCredentialsremains unbounded while its tab stays open.signal.abortedto distinguish requested disconnects from failures that should still be reported and retried.hasSyncedandlastSyncedAt.Testing
TypeScript build passes. All 13 focused tests pass across checkpoint readiness, checkpoint retry cancellation, connector signal forwarding, and disconnect error reporting.
🤖 AI Disclosure
I used Claude Code Opus 5 to investigate the issue, implement the initial changes, and draft the original PR description. I used OpenAI Codex to review the changes, simplify comments, remove connector timeouts, and update this description.