Skip to content

feat(conflict): introduce a three-way sync base and preserve both sides #104

Description

@ClaudiaFang

Priority

P1 — conflict safety

Problem

Current conflict detection can identify that both local and remote changed, but it does not maintain a complete three-way model:

base (last synced)
local
remote

Without the base version, the plugin cannot safely distinguish overlapping from non-overlapping edits or attempt an automatic merge.

Plan

  • Persist the last-synced base blob identity for each tracked file.
  • Retrieve base, local, and remote contents when a conflict is detected.
  • Introduce an explicit conflict model with path, base, local, remote, and resolution state.
  • Attempt automatic merge for non-overlapping text changes.
  • Preserve both sides when automatic merge is unsafe.
  • Define conflict artifacts or snapshots without overwriting the original silently.
  • Integrate the model with batch conflict handling in feat: support batch pull when multiple files have conflicts #95.
  • Define behavior for binary files, deleted files, moves, and unavailable base blobs.

Acceptance criteria

  • No conflict resolution path silently discards local or remote content.
  • Non-overlapping text edits can be merged deterministically.
  • Overlapping changes produce an explicit unresolved conflict.
  • Base metadata survives reopen/restart and has migration coverage.
  • Unit tests cover text merge, overlapping edits, delete/modify, move/modify, binary files, and missing base blobs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions