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

Refresh Thread bug fixes, add offline support for stateful end user client. #63

Merged
merged 13 commits into from
Jun 17, 2023
Merged

Refresh Thread bug fixes, add offline support for stateful end user client. #63

merged 13 commits into from
Jun 17, 2023

Conversation

wiverson
Copy link
Collaborator

What kind of change does this PR introduce?

Fixes some bugs and improves the stability for the background token refresh thread. Simplifies logic for refresh thread. Adds option for maximum wait time. Adds a few test cases.

No meaningful API changes (does add a distinction between invalid session and expired token).

@wiverson
Copy link
Collaborator Author

Also added support for offline mode. This only affects the stateful client non-admin JWT methods (i.e. the stateful end user client). This fixes a problem I was having where the stateful client would simply wipe out the user session if the network wasn't available. I need a user to be able to interact with the app in a mobile environment in which offline/online is a bit less reliable.

@wiverson wiverson changed the title Bug fixes refresh thread Refresh Thread bug fixes, add offline support for stateful end user client. Jun 16, 2023
@wiverson
Copy link
Collaborator Author

Ok, all set on my end to merge / review /etc. :)

Copy link
Contributor

@acupofjose acupofjose left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're awesome. This is awesome. Thanks so much!

Love the separation of TokenRefresh into it's own class and the NetworkStatus helper is very cool. Looking forward to seeing how you're using all this in unity!

@acupofjose acupofjose merged commit 4ec3e3e into supabase-community:master Jun 17, 2023
@wiverson wiverson deleted the bug_fixes_refresh_thread branch June 19, 2023 23:00
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