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

Enable override of eager conflict resolution strategy #502

Open
4 of 8 tasks
matt-ramotar opened this issue Dec 23, 2022 · 0 comments
Open
4 of 8 tasks

Enable override of eager conflict resolution strategy #502

matt-ramotar opened this issue Dec 23, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@matt-ramotar
Copy link
Collaborator

Problem

Android docs have guidance on conflict resolution once network is available. But they don’t consider cases of certain network services remaining unavailable. See https://developer.android.com/topic/architecture/data-layer/offline-first

Example

Imagine a user who can read from server but whose writes to server always fail. Normally we will eagerly resolve conflicts by pushing local writes before requesting latest values. But in this case the user can not push the local changes. We could:

  1. Discard latest server value and continue to persist local changes until server write succeeds
  2. Overwrite local changes with latest server value

Discussion (see #store-core)

@matt-ramotar - I think 1 makes the most sense. My preference is to defer to server. On first glance for me deferring to server meant overwriting with latest server value. However I think that is incorrect. I think deferring to server really means not discarding local changes until server receives them and makes a decision.

@digitalbuddha - Some folks might want destructive reads even when local writes exist.

Decision

Defer to server by default but enable configuration when:

  • Online + No Changes
  • Online + Changes
  • Offline + No Changes
  • Offline + Changes
  • Can't Update + No Changes
  • Can't Update + Changes
  • Can't Read + No Changes
  • Can't Read + Changes
@matt-ramotar matt-ramotar added the enhancement New feature or request label Dec 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant