Comments (4)
We had a similar issue with the nhost-js-sdk.
This was our solution there:
https://github.com/nhost/nhost-js-sdk/blob/master/src/Auth.ts#L639-L650
from nhost-dart.
Yes! I saw that while porting, and do have questions about that (since people are now building for Flutter Web.)
But in this case, it's not exactly the same issue.
What I'm seeing is Android suspending all network activity while "dozing" (a state that is entered after a few minutes of the screen being off). In this state, application code continues to run, which includes timer callbacks (possibly at a reduced or less exact rate), but network requests never go out (so JWTs don't refresh), and websocket keep alives never come in (leading to socket disconnects+reconnection attempts).
When everything wakes back up, it's in a bad state, because you have a websocket queued up to send its initial payload (which will contain the "current", stale, JWT), and a JWT refresh queued up that whose response won't be received before that payload is sent.
from nhost-dart.
It actually also occured on iOS
from nhost-dart.
Ah, well I believe it's even simpler in that case.
iOS standby mode is a lot like Doze from what I've read, but is even stricter. I should be able to repro the issues I've seen there with the same testbed.
Thank you for letting me know.
from nhost-dart.
Related Issues (20)
- How to save login status? When I log in and restart the application, the login status disappears HOT 3
- localhost (10.0.2.2) not working for Android emulators HOT 2
- Bump dependencies versions
- Dart client should accept/prefer "local" as subdomain for local-cli development now that localhost is deprecated HOT 8
- auth url incorrect HOT 2
- http can not be updated because of the 'betamax' package HOT 6
- OAuth redirect URI mismatch HOT 7
- Fix CI
- Upgrading to Dart 3 and Flutter 3.10 HOT 1
- Nhost gql link uses websocketlink incorrectly for queries that appear in a document that also has subscriptions
- [nhost_graphql_adapter] bump http ^0.13.5 dependency HOT 1
- No clear way to provide the admin-token HOT 1
- remove backendUrl
- New Flutter 3.16.0 includes Dart 3.2.0 and nhost_dart is not compatible HOT 1
- How to choose user role when doing a request? HOT 2
- nhost_dart 2.0 and nhost_graphql_adapter 4.0 are not compatible HOT 2
- dependencies issue HOT 5
- How to use Hasura GQL subscription query? HOT 1
- Run gql query from flutter tests without mocking
- storage function uploadBytes requires "name", but the column is nullable HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nhost-dart.