fix: Http clients getting stuck on 401#1034
Merged
Merged
Conversation
…onses, which caused an endless auth-error retry loop when the token expired while the stream was disconnected.
🦋 Changeset detectedLatest commit: 6a54114 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 |
Chriztiaan
marked this pull request as ready for review
July 9, 2026 13:30
simolus3
approved these changes
Jul 9, 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.
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.