Sync Obsidian both ways so notes Simba writes reach your devices #86

Merged
ryan merged 1 commits from feat/obsidian-write-sync into main 2026-10-13 08:11:47 -04:00
Owner

Simba can create notes and tasks and add or complete journal tasks, but the container ran Obsidian Sync with --mode pull-only, so those writes never left its local copy of the vault.

  • OBSIDIAN_SYNC_MODE (new, in .env.example and compose, validated) defaults to bidirectional, with --conflict-strategy merge. pull-only and mirror-remote are still available.
  • Blue-green safety: both colors bind-mount ./obvault, so during a deploy two sync clients would write one vault and its sync state. Setup and ob sync --continuous now run under flock on <vault>/.raggr-sync.lock. The new container waits until the old container's sync process exits, then clears Obsidian's stale .sync.lock (safe inside our lock) and starts.
  • Setup now runs in the background, so app startup no longer waits for ob login.

Verified:

  • ob sync-config --help for obsidian-headless 0.0.8 lists the three modes.
  • flock ships in the base image (util-linux 2.38.1).
  • Two containers sharing a native Linux volume serialize correctly: the second waited exactly until the first released. Docker Desktop for Mac bind mounts do not carry flock between containers, but the server is Linux.
  • 471 unit tests and Ruff pass.

Watch on the first deploy: the lock adds one more sync client to Obsidian's history under OBSIDIAN_DEVICE_NAME. The first bidirectional sync uploads anything Simba wrote locally while sync was pull-only.

🤖 Generated with Claude Code

Simba can create notes and tasks and add or complete journal tasks, but the container ran Obsidian Sync with `--mode pull-only`, so those writes never left its local copy of the vault. - `OBSIDIAN_SYNC_MODE` (new, in `.env.example` and compose, validated) defaults to `bidirectional`, with `--conflict-strategy merge`. `pull-only` and `mirror-remote` are still available. - **Blue-green safety:** both colors bind-mount `./obvault`, so during a deploy two sync clients would write one vault and its sync state. Setup and `ob sync --continuous` now run under `flock` on `<vault>/.raggr-sync.lock`. The new container waits until the old container's sync process exits, then clears Obsidian's stale `.sync.lock` (safe inside our lock) and starts. - Setup now runs in the background, so app startup no longer waits for `ob login`. **Verified:** - `ob sync-config --help` for obsidian-headless 0.0.8 lists the three modes. - `flock` ships in the base image (util-linux 2.38.1). - Two containers sharing a native Linux volume serialize correctly: the second waited exactly until the first released. Docker Desktop for Mac bind mounts do *not* carry flock between containers, but the server is Linux. - 471 unit tests and Ruff pass. **Watch on the first deploy:** the lock adds one more sync client to Obsidian's history under `OBSIDIAN_DEVICE_NAME`. The first bidirectional sync uploads anything Simba wrote locally while sync was pull-only. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
ryan added 1 commit 2026-10-13 08:10:50 -04:00
Sync Obsidian both ways so notes Simba writes reach your devices
CI / backend (pull_request) Successful in 42s
CI / frontend (pull_request) Failing after 6s
CI / backend (push) Successful in 41s
CI / frontend (push) Failing after 7s
b02bf0a6df
The container ran Obsidian Sync in pull-only mode, so notes, tasks and journal
entries the agent wrote stayed in its local copy. OBSIDIAN_SYNC_MODE now
defaults to bidirectional (merge on conflict); pull-only and mirror-remote
remain available.

Blue and green share the vault volume, and two sync clients writing one vault
and its sync state would race during a deploy. Setup and sync now run under a
flock on a file in the vault, so a new container starts syncing only after the
old container's sync process exits. Clearing Obsidian's stale sync lock is safe
inside that lock. Setup runs in the background, so startup no longer waits for
Obsidian login.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Author
Owner

Correction: the suite run for this PR was 570 unit tests passing (not 471).

Correction: the suite run for this PR was 570 unit tests passing (not 471).
ryan merged commit bae2e75625 into main 2026-10-13 08:11:47 -04:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: ryan/simbarag#86