Skip to content

ob sync --continuous overwrites remote files with stale/empty local copies #15

@lance0

Description

@lance0

Bug Report

Environment

  • ob version: latest as of 2026-03-26
  • Node.js: 22+
  • OS: Ubuntu (headless server) + macOS (desktop)
  • Sync plan: Active

Description

Running ob sync --continuous in bidirectional mode causes files to be overwritten with stale/empty local copies, resulting in data loss across all synced devices. Initially observed on a headless Linux server, but the root cause was traced to a macOS desktop device — the bug is in the shared sync engine.

Steps to Reproduce

  1. Have a vault actively synced to Obsidian Sync from multiple devices
  2. Edit or create files on one device — Sync pushes them to remote
  3. Another device (running continuously) picks up the changes but re-uploads stale local copies, overwriting the valid remote content

Observed Behavior

Files oscillate between their correct content and 0 bytes (or frontmatter-only). The Obsidian Sync version history shows a clear pattern:

version 1:  0 B        (stale push)
version 2:  2.34 KB    (correct content)
version 3:  1.67 KB    (partial/frontmatter only — stale push)
version 4:  2.34 KB    (corrected)
version 5:  1.67 KB    (stale push again)
...repeating

Expected Behavior

After downloading a remote change, the sync engine should not re-upload the file it just downloaded.

Impact

Silent data loss. Files appear to save correctly but are quietly overwritten. Recovery is possible via version history, but only if caught in time.

Workaround

Use --mode pull-only on devices that don't need to push changes.

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