MobileNativeFoundation / MobileNativeFoundation/Store

Enable override of eager conflict resolution strategy

Open
#502 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Kotlin
Stars
3.4k
Forks
217
Avg merge
18m
Merged PRs (30d)
4

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the conflict-resolution implementation discussed in #store-core and compare its behavior with the Android offline-first guidance linked in the issue. Trace the eager strategy across the listed online/offline and read/write-failure cases. Done means the default defers to the server while configuration supports the four currently unchecked cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
kotlin
Domain
distributed-systems
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.