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

Offline Support #1176

Open
18 tasks
CarsonF opened this issue Oct 25, 2022 · 0 comments
Open
18 tasks

Offline Support #1176

CarsonF opened this issue Oct 25, 2022 · 0 comments

Comments

@CarsonF
Copy link
Member

CarsonF commented Oct 25, 2022

  • Service worker:
    • Load static files
    • Handle page loads. Maybe respond with single entrypoint / which has our env config and let app do a render instead of a hydrate
    • API files/images maybe?
  • Queries:
    • apollo-cache-persist restore cached query data on load.
      • Cache policy needs to be changed in order to prevent stale cache
        • Maybe cache-and-network
        • We don't want that to keep hitting network though. Maybe cache-first for nextFetchPolicy. I'm not sure that works across component (un)mounts...
        • These can be applied in defaultOptions instead of every query.
  • Mutations:
    • apollo-link-queue to store pending mutations when offline
    • apollo-link-serialize execute mutations in serial instead of all in parallel
      • This example uses the same serialization key for all mutations.
    • All operations will need optimisticResponses, so that the UI can show the pending value before it sent to server.
    • The queued list still needs to be persisted.
      • Most of the data (name, query, variables, other context) is JSON-able so that part is relatively straight forward.
      • The update function is not. Maybe we can extract all update functions and store them in a central place via Babel. Then JSON persist the function name & args.
  • Show UI for syncing to server when coming back online. "Sending 4/5 changes"
  • How to handle errors from API?
  • How to de-dupe pending operations for same thing? (like auto-save for the same field)
  • How to handle different IDs from dependent operations? i.e. Create Project -> Create Engagement. If create engagement references a temporary project ID then how does that get switched over to the real ID from server?

┆Issue is synchronized with this Monday item by Unito

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

No branches or pull requests

1 participant