-
-
Notifications
You must be signed in to change notification settings - Fork 16
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
Potential issue with offline mutation queue / is online logic #37
Comments
hi @octodhruv, can you send me the creation of the environment? |
Hi @morrys. Thanks for your reply. Of course, it is below:
I'm sure we are using the
I also am not 100% sure what the useRestore hook would have to do with this issue of the offline mutation queue not firing correctly, immediately when we go online, but instead when we refresh the app in the simulator, or hard close and re-open the app. Maybe I am misunderstanding the issue? Thanks for the help! Please let me know if I can provide anything else |
@octodhruv the useRestore hooks in addition to rehydrating the stores, adds the listener on the events of the NetInfo library. Another useful piece of information is the version of the @react-native-community/netinfo library. I recommend trying to use the netinfo library and adding another listener and actually checking if the connection is detected. |
"@react-native-community/[email protected]" is our current version. Thanks for the recommendation! so you think we can use this library to see that it's firing correctly? Thanks! |
Offline mutation queue execution is performed here: https://github.com/morrys/wora/blob/master/packages/offline-first/src/OfflineFirst.ts#L103 In practice, when a change of connectivity is determined by the NetInfo library and the connection is present, the processing is performed. |
Hi @octodhruv, any news? |
hi @octodhruv, react-native-netinfo/react-native-netinfo#7 When you can you can confirm that you are using the iOS simulator and that the problem does not persist in android or real device? |
Hi @morrys Apologies for my delayed response, and thanks for looking into it! I can confirm that the problem is indeed with the simulator - i saw that issue myself. Sorry for any problems! We believe our issue may be rooted somewhere else... |
Don't worry :) being a problem of the simulator I close the issue. for doubts or other problems, open another issue :) |
Hi!
I've been testing the offline logic around firing mutations in our app, and it seems like the offline mutation queue isn't firing until we hard close our react-native app - then it fires.
When I come online, the queryRenderer completes queries correctly, but otherwise doesn't seem to fire the expected mutations, until later when we hard close the app.
There may be an issue here with the isOnline detection in the library - or maybe I'm not doing something right!
I hope that is helpful.
versions:
The text was updated successfully, but these errors were encountered: