[Bug] CLI: File chunks not replicated to remote - files appear empty (size 0)

Author: lukemcguireCreated Mar 25, 2026Updated Sep 18, 2026
Labelsawaiting confirmation

Bug Description

When using the LiveSync CLI to push files to the local database and then sync to a remote CouchDB, the file metadata is replicated but the content chunks are not. This results in empty files (size 0) on the remote database.

Environment

  • LiveSync version: 0.25.54 (CLI built from main branch)
  • Node.js: v24.14.0
  • OS: Linux (VPS)
  • Remote: CouchDB on Synology NAS via nginx reverse proxy

Steps to Reproduce

  1. Build and run the CLI:
bash
cd src/apps/cli
npm run build
node dist/index.cjs /path/to/local/db --settings /path/to/settings.json push /source/file.md "vault/path/file.md"
  1. Verify file is in local database with content:
bash
node dist/index.cjs /path/to/local/db --settings settings.json info "vault/path/file.md"

Output shows: size: 13325, chunks: 12, children: [h:+odnnbu1n8yob, ...]

  1. Sync to remote:
bash
node dist/index.cjs /path/to/local/db --settings settings.json sync
  1. Check remote via curl:
bash
curl -u user:pass https://couchdb/db/f:hash | jq '{_rev, size}'

Output shows: size: 0 (empty file)

  1. Verify chunks are missing on remote:
bash
curl -u user:pass https://couchdb/db/h:+odnnbu1n8yob
# Returns: {"_id": null, "_rev": null} (not found)

Expected Behavior

Both file metadata AND content chunks should be replicated to the remote CouchDB during sync, making the file accessible to other devices.

Actual Behavior

  • File document is created on remote with revision bumped (e.g., 4-5c7a...)
  • File size field is 0 on remote
  • Chunk documents (type h:+...) are not present on remote
  • Other devices see the file entry but cannot retrieve content

Additional Context

  • Settings used: readChunksOnline: true, encrypt: true, liveSync: true
  • The local database correctly stores chunks (verified via info command)
  • Sync reports [Done] Command 'sync' completed with no errors
  • Obsidian plugin sync works correctly between laptop/mobile and same CouchDB
  • This appears to be CLI-specific; the plugin's sync logic properly handles chunks

Related

  • Issue #815 - CLI feature request (the CLI exists now, but chunk replication appears broken)

Source: vrtmrz/obsidian-livesync