Skip to content

fix: Http clients getting stuck on 401#1034

Merged
Chriztiaan merged 1 commit into
mainfrom
fix/http-401-not-reconnecting
Jul 9, 2026
Merged

fix: Http clients getting stuck on 401#1034
Chriztiaan merged 1 commit into
mainfrom
fix/http-401-not-reconnecting

Conversation

@Chriztiaan

Copy link
Copy Markdown
Contributor

Duplicate of this backport: #1033

Originally reported internally.

Fixed an issue where clients using the HTTP connection method could get stuck in an endless auth-error retry loop when their token expired while disconnected (e.g. after network interruptions or device sleep).

Unlike the WebSocket path and other HTTP requests, the HTTP sync stream did not invalidate cached credentials when receiving a 401 response, so every reconnect attempt reused the same expired token instead of fetching a fresh one from the connector. The sync stream now invalidates cached credentials on a 401, so the next retry calls fetchCredentials() for a fresh token.

AI disclosure

This PR was created with the help of Claude Fable. Help constitutes assistance in research, planning, and rough outline of implementation. Beyond having a hand in the implementation, I have also manually tested this work.

…onses, which caused an endless auth-error retry loop when the token expired while the stream was disconnected.
@changeset-bot

changeset-bot Bot commented Jul 9, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 6a54114

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 7 packages
Name Type
@powersync/shared-internals Patch
@powersync/adapter-sql-js Patch
@powersync/capacitor Patch
@powersync/node Patch
@powersync/react-native Patch
@powersync/web Patch
@powersync/diagnostics-app Patch

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

@Chriztiaan
Chriztiaan marked this pull request as ready for review July 9, 2026 13:30
@Chriztiaan
Chriztiaan requested a review from simolus3 July 9, 2026 13:30
@Chriztiaan
Chriztiaan merged commit 6aef3ac into main Jul 9, 2026
16 of 17 checks passed
@Chriztiaan
Chriztiaan deleted the fix/http-401-not-reconnecting branch July 9, 2026 17:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants