Repository navigation
Conversation
The HTTP sync stream only had a timeout until the response started. A stream that died without closing (a network change, a proxy or NAT dropping it) kept reporting connected and never received anything again. The service sends a keepalive line every 20 seconds, so a read that gets nothing for 30 seconds now fails the stream: the error shows up in the sync status and the client reconnects after retryDelayMs. WebSocket connections already use the same timeout. Closes powersync-ja#1208
🦋 Changeset detectedLatest commit: a373781 The changes in this PR will be included in the next version bump. This PR includes changesets to release 8 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 |
This branch has not been deployed
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.
closes #1208
the HTTP sync stream only had a timeout until the response started (
connectTimeoutMs). after that, a stream that died without closing (network change, proxy or NAT dropping it) kept the clientconnectedwith nothing arriving, until something else made it reconnect.the service sends a keepalive line every 20 seconds, so
fetchStreamRawnow fails a read that gets nothing for 30 seconds and cancels the response. the error takes the normal path: it shows up asdownloadError, the status goes to disconnected, and the client reconnects afterretryDelayMs. 30 seconds is what the WebSocket path already uses (SOCKET_TIMEOUT_MS).the timer only runs while a read is waiting for data, so a client thats slow to process lines doesn't trip it.
I kept it a constant like the WebSocket one. if you'd rather have it configurable (the issue mentions that,) I can add a
SyncOptionsfield next toconnectTimeoutMs.tests, in
packages/node/tests/sync.test.tswith fake timers like the WebSocket timeout test:mainran the common, shared-internals, node and web tests locally on Node 26 (and node's on Node 24), all passing. there's a patch changeset for
@powersync/shared-internals