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

[graphql-client] Local-first state management plugin #102

Open
agritheory opened this issue Apr 6, 2024 · 0 comments
Open

[graphql-client] Local-first state management plugin #102

agritheory opened this issue Apr 6, 2024 · 0 comments
Assignees

Comments

@agritheory
Copy link
Owner

agritheory commented Apr 6, 2024

Design objectives:

  • Server remains long-term source of truth
  • Sensitive to "submitted"/ immutable state of documents
  • Able to "replay" state when updates (WS/ subscription or HTTP response via GraphQL) received from server

User stories

All queries should be normal requests and will not use optimistic updates

Mutations

  • Client sends request and does an optimistic update, saving the hash of the request to
  • Server responds immediately without commit to DB with hash of request as request id and timestamp
    • whatever action is required is enqueued and handled by the server
  • Successfully completed mutations are pushed back to the client and are reconciled in the undo queue as resolved

Network Issue

  • In case of a network issue where the server is sending its response to the client, it should inspected the undo queue for unresolved actions and request an update (related to [stonecrop] Undo in Pinia #115)

Errors

This should be implemented as a finite state machine

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

3 participants