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

Queue offline writes #7

Open
michaelyfan opened this issue Mar 11, 2020 · 0 comments
Open

Queue offline writes #7

michaelyfan opened this issue Mar 11, 2020 · 0 comments
Labels
enhancement Enhances existing features/processes

Comments

@michaelyfan
Copy link
Member

michaelyfan commented Mar 11, 2020

Firestore handles offline write requests by never completing the request's future until internet connection comes back online. This is not optimal if a person is in a low-connectivity area for a while. The app currently waits five seconds for the future to complete before assuming that Firestore is waiting, notifies the user, and then proceeds as if the request was successful, and later completes the write when the app receives internet connection again. This is not ideal either as it may suppress errors silently, and may surprise the user as write request status is currently not exposed.

One way to help remediate these problems is to expose offline writes in a queue page, so that the user is not left with surprises. Unfortunately, this still doesn't handle submission errors. Additionally, if there is no way to get Firestore's pending writes, we may have to store them ourselves--though this may allow us to handle submission errors as we will still have submissions that fail, and be able to retry.

There may be a better solution.

Also applies to recycling_checkin

Notes:

  • a queued write silently fails (ex. changing write rules in between a write being queued and a write going to Firestore) unless caught, but catching is difficult across app sessions and when the user has moved onto other screens by then
    • after going offline the Firestore plugin has no knowledge of updated security rules, and queued writes affected by updated security rules will fail
  • this is addressed by Firebase, and their recommended solution is ensuring the app does not rely on completed futures, and the offline write will apply once the device is reconnected. This is still somewhat troublesome; what if a queued write fails?
@michaelyfan michaelyfan added the enhancement Enhances existing features/processes label Mar 11, 2020
@michaelyfan michaelyfan self-assigned this Mar 11, 2020
@michaelyfan michaelyfan removed their assignment Jan 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhances existing features/processes
Projects
None yet
Development

No branches or pull requests

1 participant