Store icon indicating copy to clipboard operation
Store copied to clipboard

Enable override of eager conflict resolution strategy

Open matt-ramotar opened this issue 3 years ago • 0 comments

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:

  • [x] Online + No Changes
  • [x] Online + Changes
  • [x] Offline + No Changes
  • [x] Offline + Changes
  • [ ] Can't Update + No Changes
  • [ ] Can't Update + Changes
  • [ ] Can't Read + No Changes
  • [ ] Can't Read + Changes

matt-ramotar avatar Dec 23 '22 03:12 matt-ramotar