Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix] Refresh Credentials #11

Merged
merged 7 commits into from
Apr 9, 2024
Merged

[Fix] Refresh Credentials #11

merged 7 commits into from
Apr 9, 2024

Conversation

stevensJourney
Copy link
Contributor

@stevensJourney stevensJourney commented Apr 5, 2024

Description

Previously the PowerSyncBackendConnector would not clear the pending fetchRequest after it resolved. This would result in the same cached credentials being used after they were expired or invalidated.

Notice subsequent connections immediately get the response that the (re-used) token is expiring
image

Additional changes

  • HTTP error responses are now thrown for bad sync/stream responses.
  • Sync retry logic is now moved to the streamingSync level

Testing

A short token lifetime of 30 seconds was used. The video below shows how the sync stream correctly reconnects.

refreshtokens.mp4

@stevensJourney stevensJourney marked this pull request as ready for review April 8, 2024 09:25
Manrich121
Manrich121 previously approved these changes Apr 8, 2024
DominicGBauer
DominicGBauer previously approved these changes Apr 8, 2024
@DominicGBauer DominicGBauer merged commit da8cecd into main Apr 9, 2024
3 checks passed
@DominicGBauer DominicGBauer deleted the credential-fix branch April 9, 2024 07:57
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.

3 participants