Open keithamoss opened 7 months ago
This would also be useful for when the connection is poor. Which maybe we could detect too?
Ideally we'd be able to background sync automatically once the user is on a good connection. Not sure if that's possible with a PWA on iOS? Maybe that's where Service Workers come in though?
Service Workers look like the go for easier offline caching of all of the assets we need. i.e. They're good at intercepting network requests and returned a cached verison.
The user believes built-in offline support would be useful. e.g. When truly offline or just when on an unreliable / low bar count connection like in the hills around Kalamunda et cetera.
Relevant links
At the time of writing the two main libraries that used to provide offline support with Redux appear to be entirely abandoned and nothing is rising up to take their place.
There's a GitHub issue (xx) where various people, and the authors of Redux Toolkit and RTK Query, discuss offline support. Again, at the time of writing, no decision is taken to add support into the library, integrate with third party libraries (there are none, per above), nor offer any doco or patterns showing how to implement offline support alongside Redux Toolkit and RTK Query.
The second link above (the Innoq blog post) appears to be our best bet. It's a well thought out argument in favour of its approach and it's a generic pattern we could - seemingly - apply within our architecture.
It's silent on use of local storage (I think?), but that's the logical choice.
Questions for the user to inform the POC and design:
Next steps:
Other considerations:
Lots of food for thought!