Skip to content

[bug] Sync-internal LWW conflicts shown as 'Your edit conflicted' toasts for nodes the user never edited #1684

Closed

Description

@mstomar125

Surfaced during the live write-starvation validation (2026-07-17).

Observed: the daemon resolved a batch of sync-internal LWW conflicts on nodes the user never touched (all on "Recovered Items" nodes — the daemon's own reconcile, cloud-wins). The frontend showed one "Your edit conflicted with a remote change" toast per conflict (a stack of them), even though the user made no edit to those nodes.

Why it matters: the toast is user-facing and phrased as "Your edit conflicted", but these were background reconcile/LWW resolutions on nodes outside the user's current view/edits. It's misleading (implies the user lost their work) and spammy (one toast per node during a reconcile burst).

Fix direction: only surface a conflict toast when the conflict is on a node the user is actively editing (or whose optimistic local edit was actually dropped from the UI). Suppress/aggregate conflict notifications for background sync/reconcile resolutions on nodes not in the active edit set. Related root cause: nodespace-cloud#82 (reachability timeout that caused the thrash) + nodespace-sync#334 (the Recovered-Items churn that generated the conflicts).

Activity

  1. mstomar125 commented on Aug 1, 2026

    @mstomar125
    ContributorAuthor

    Verified fixed on current main (2026-08-01)

    Traced every path that raises a conflict toast (conflictNotifications.add — the only emitter is shared-node-store.svelte.ts). There are exactly three, all user-relevant:

    1. OCC VERSION_CONFLICT — the daemon rejected the user's own write (version mismatch).
    2. A genuinely-newer foreign database-sourced write to an ACTIVELY-EDITED node — via decideRemoteUpdate, gated on isFocused || hasPending.
    3. A local write-failure — the user's own change didn't save.

    The exact scenario this issue reported — a background sync-internal LWW / reconcile resolution (cloud-wins) on a node the user never touched (e.g. Recovered Items) — arrives as a database-sourced WatchNodes event to a node that is not actively edited, so decideRemoteUpdate returns apply: true with no notifyConflict — it is applied silently, no toast. Pinned by remote-update-policy.test.ts: "applies when the node is not actively edited (not focused, no pending write)".

    What fixed it (all landed after this report): the daemon now suppresses a connection's own WatchNodes echoes authoritatively via x-ns-client-id (#1691), replacing the racy content-comparison heuristic that produced false-positive toasts; the conflict-toast churn cleanup (#1693); and the decideRemoteUpdate extraction with the actively-edited gate (#1608 / #1512). A conflict is now surfaced only when it's on a node the user was actually editing — exactly this issue's fix direction.

    Closing as resolved. (Root-cause thrash drivers cloud#82 + sync#334 were also fixed separately.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions