-
-
Notifications
You must be signed in to change notification settings - Fork 4
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
Restoring optimistic response after application restarts? #3
Comments
This through a utility function to know the connection status Finally, when the status returns online, the queue execution workflow is executed and the library allows simple options to extend the default behavior of the extension. This workflow will soon be well documented. |
I think this should be in userland this is too specific to be in a package we can have another package that provide common offline behaviors
that would handle this for apps that needs this |
maybe you wanted to refer this question to |
For exmaple:
With wora the second edit is sending an invalid id - it will send an optimistic response id. |
Reason, why I'm asking, is that there are couple things that can be provided to enable wora to be the really comprehensive library. I was always dreamed of having a fully offline workflow. I really like @sibelius suggestion! I have couple ideas to help here to make this better, but I will love to first know the motivation. Any reason why developers need to handle those cases in execute? |
I have more knowledge on relay I think all mutations called when offline ("optmistic updates") are already persisted to relay store, so we don't need to restore them when application restarts, they are already there what happens if that we rollback optimistic updates that fails to complete on server More on this here https://dev.to/mattkrick/distributed-state-101-why-i-forked-facebook-s-relay-1p7d for me offline events are much like optimistic events where the server event is very delayed |
@wtrocki this is my lack of documentation that I will update. What I recommend to those who intend to handling offline is: with this simple requirement we obtain a remarkable resolution of problems and an efficiency in the processing of responses and data stores. |
WOW, it is nice to see that relay actually gives such a feature. In Apollo, things look differently. Optimistic responses are not kept/persisted but I'm hoping to fix that so the behavior will be the same for Apollo/Relay! Thanks. |
on this subject I would like to talk to those who deal with apollo cache inmemory. In a first version I also persisted the optimistic layer but the problem is another. My approach to both relay and apollo is the same:
In relay it is possible, after restarting the application, to use the |
I think I can help with not possible on Apollo as we have done that in other library. Did you thought about having entire InMemory cache code inside and persisting all together? |
@wora/offline-first support restoring optimitisic responses into cache?
Do you see persisting optimistic response layer in the future or library will apply this some different way?
The text was updated successfully, but these errors were encountered: