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

Creating related records offline #669

Open
mdeitner opened this issue Jul 18, 2022 · 0 comments
Open

Creating related records offline #669

mdeitner opened this issue Jul 18, 2022 · 0 comments

Comments

@mdeitner
Copy link
Collaborator

Currently when creating records offline we make use of Apollo's optimistic response so the offline records can be displayed in the UI and then automatically persisted to the database when the app regains connectivity. This works well for records that are not related to other records but can become complex for related records. Specially for creating new service entries and associated new clients.

With the current solution, service entries are created without their associated client and then updated once the client record has been persisted. Since we don't control the order of record creation when the app regains connectivity a map of service entries to clients must be maintained in order to know what service entries need to be updated (it's possible the client creation request returns before the service entry request).

A better solution might be to take advantage of some graphQL features so that offline service entries and associated clients can be sent in one request.

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