Business · Product · Technology · AI

Make preference conflict rebasing explicit and bound the retry

A Movo-X appearance case contrasting the selected Swift full-value rebase with Android supplied-timestamp conflict choices, narrow wire fields and retained local-only state.

Work directly with Omer Muneer Qazi · Reviewed 29 November 2026

The scenario: another device changes a preference before this save arrives

A native app can keep display preferences locally so it can render before the network answers. Those preferences can also follow the account across devices. When two devices save against different server versions, the client needs an explicit decision about what to retain and how many times to retry.

The inspected Movo-X appearance synchronizer distinguishes clean pulls, dirty patches, a conflict rebase and local-only fallback. This case examines that policy with four existing portable tests and two supplemental fake-remote fixtures. It concerns appearance data; it does not generalize the same conflict policy to medicines, clinical notes or financial records.

Track visible values separately from synchronization bookkeeping

The local preference model contains theme, colour mode and an optional accent alongside a version and dirty flag. A helper compares visible values independently of the synchronization fields. This allows a saved version change to be distinguished from an actual change in what the person selected.

For a clean local model, the synchronizer reads the service and adopts its copy when the install has no synchronized version or the server version is newer. The selected pull fixture retains the server’s dynamic colour mode rather than rewriting it just because iOS presents that mode differently. Successful decoding is not a claim about every rendered colour or screen.

Make the initial patch relative to a known baseline

The update builder compares local values with the supplied baseline and includes selected changed fields. A theme-only initial change need not send an unrelated colour mode. A custom-colour change includes the associated accent where the implementation’s contract requires it.

The existing patch fixture checks those selected field choices and the supplied optimistic version. This is a useful way to avoid sending every optional preference on every ordinary save. Its meaning still depends on the caller providing the intended baseline; a minimal patch cannot reconstruct which actions a person took if that baseline has already been lost or replaced.

Treat a conflict as a new comparison rather than an endless repeat

On its first HTTP 409, the inspected synchronizer reads the current server preferences, updates the attempted version and computes another patch relative to that new baseline. It permits that rebase once. The existing conflict fixture checks a successful save after the fake server changes its version.

The supplemental persistent-conflict fixture refuses both writes. It checks two patch attempts, one intervening read and a failed result retaining the original dirty local preferences. This establishes a bounded selected conflict path, not a claim that every network request in the broader API client is limited to two; authentication and transport behaviour have their own layers.

A refreshed baseline changes which local differences are sent

The rebase compares the full current local preference model against the refreshed server copy. It does not carry an operation log listing only fields touched in the original user action. That distinction affects what happens when the other device changed a different preference.

A supplemental fixture changes only the local theme initially, while the refreshed fake server also has a different colour mode. The first patch omits colour mode; the rebased patch includes the local colour mode because it now differs from the new baseline. The chapter therefore describes a full-local-value rebase policy, not a guarantee that unrelated concurrent server changes are preserved.

Keep payload rebasing distinct from replaying an identical request

The source creates a request identifier for each preference update call. After a conflict, the version and potentially the changed fields differ, so the second update is a rebased attempt rather than a byte-identical replay of the original payload.

That differs from the proof-gating path, where the same prepared request is repeated after satisfying a requirement. Both can be deliberate behaviours, but they answer different contracts. The selected preference tests do not establish the service’s deduplication window, exactly-once execution or the handling of a save whose response was lost after a commit.

Local-only fallback is different from a synchronized result

If the preference endpoint answers not found, the synchronizer returns a local-only result with the local values retained. Other failures return failed with the same local model. The selected older-server fixture checks that a dirty preference remains available for a later opportunity rather than being falsely acknowledged as synchronized.

These result states let callers distinguish an accepted service save from a locally usable choice. The fixtures use in-memory models and fake remotes, so they do not prove process-restart durability or that every app lifecycle event preserves the dirty baseline. They also do not certify accessibility or appearance rendering merely because the preference synchronization succeeds.

Compare Android supplied-timestamp decisions with the Swift rebase

Eleven additional Android cases now cover clean pulls, dirty pushes, selected local/server conflict choices, offline/local-only outcomes, stale mock versions, wire fields, invalid accent handling and account-style clearing. The Android synchronizer compares supplied updatedAt values after a conflict and, when selected local values win, rebases their version and permits another write. This differs from the Swift full-local-value comparison described above.

The fake Android remote supplies meaningful timestamps. The inspected production wire decoder constructs the local preference model with a neutral timestamp, and that timestamp is not one of the encoded preference fields. Those facts limit what the conflict fixtures establish. They do not prove a current cross-device latest-human-edit ordering. Current service metadata, clock policy and actual integration need separate acceptance; the selected platform policies should not be described as identical.

Separate Android model cleanup from persistence and in-flight lifecycle

The Android wire fixture checks the selected flat theme/colour/accent/card-style/version fields and retains a device-supplied default card style when decoding the selected server shape. Another fixture drops an invalid accent. The account-cleanup fixture preserves selected device appearance values, removes per-card styles and resets the model version. It calls a value helper rather than driving actual sign-out.

Source inspection connects the store to private preferences, debounced synchronization, a mutex and an account-wipe callback. It also checks whether local state changed while a request was in flight before publishing a result. Those lifecycle connections were not executed by the eleven cases. The selected helper results do not prove process-restart durability, every account transition, cancellation or cleanup of all personal data.

A useful conflict-policy handover

Specify the initial baseline, optimistic-version rules, rebase policy and retry bound. Test an ordinary patch, a newer clean server value, one resolvable conflict, a repeated conflict and an older server without the endpoint. Include a concurrent change to a different field so the intended merge semantics are visible.

For a CTO, the benefit is a conflict strategy reviewers can name and challenge precisely. The inspected implementation and six scoped cases establish selected preference behaviour. They do not substitute for a server concurrency contract, real multi-device acceptance or a decision about whether a future feature needs field-intent tracking instead of full-local-value rebasing.

Compare the reviewed boundaries

Different outcomes of an appearance sync pass

On smaller screens, scroll across to compare every column. Keyboard users can focus the table and use the arrow keys.

ConditionInspected decisionSeparate contract
Clean local values and newer server versionAdopt selected server preferencesCorrect baseline and rendered appearance
Dirty values against current baselineSend selected differences with versionServer concurrency and idempotency
First conflictRead server and rebase full local values onceIntended treatment of concurrent fields
Repeated conflict or absent endpointRetain local model as failed or local-onlyPersistence lifecycle and later retry policy

Illustrative control flow

Pseudocode summarizing the decision boundary. It is not copied production code or a deployment instruction.

if local_is_clean:
    pull_and_adopt_according_to_version()
else:
    try_patch(local_difference_from_baseline, version)
    on_first_conflict:
        server = read_latest_preferences()
        try_once(local_difference_from(server), server.version)

# Full-local-value rebase is not an original-field-intent log.

About this engineering series

Written by Omer Muneer Qazi from a review of Movo-X implementation and dated engineering records. This article explains source behaviour and historical observations; current production, clinical outcomes and store availability require their own verification. Examples are synthetic and proposed test cases are identified as such.

Explore the Movo-X engineering series → · Related implementation experience →

Discuss a similar engineering problem

Send the workflow, current platform and the decision your team needs to make. I can help define an implementation or review scope with concrete acceptance evidence.

Discuss your project on WhatsApp ↗
WhatsApp Omer about this project ↗