test: align Fetch recovery diagnostics

This commit is contained in:
vorotamoroz committed 2026-11-09 02:58:08 +00:00
1 parent a43882d743
commit f6563609e6
2 files changed
+8 -3

No files matched your search

+1 -1
View File
@@ -94,7 +94,7 @@ livesync-cli [database-path] [command] [args...]
- `fetch`: Replace the local database with the configured remote state, then reflect fetched files to the selected Vault. Existing local database state is discarded, so this command requires `--force`.
- The selected local database suffix is saved automatically, including when `--write-settings` is omitted.
- Differing local files can remain and be preserved as conflict branches alongside the fetched content. For recovery from an intact remote, preserve the existing Vault separately and Fetch into an empty Vault; `--force` does not force file overwriting.
- CouchDB content checks obtain missing Chunks through the ordinary retrieval policy, including when **Fetch chunks on demand** (`readChunksOnline`) omits them from replication. **Use Only Local Chunks** (`useOnlyLocalChunk`) still prevents direct remote requests. If required content remains unavailable, Fetch fails and retains its reconstruction record; use `--verbose` to inspect the affected path and retrieval setting.
- CouchDB content checks obtain missing Chunks through the ordinary retrieval policy, including when **Fetch chunks on demand** (`readChunksOnline`) omits them from replication. **Use Only Local Chunks** (`useOnlyLocalChunk`) still prevents direct remote requests. If required content remains unavailable, Fetch fails and retains its reconstruction record; use `--verbose` to inspect the affected path and shortened revision.
- `ls [prefix]`: List files currently stored in the local database.
- `push <src> <dst>`: Push a local file `<src>` into the database at path `<dst>`.
- `pull <src> <dst>`: Pull a file `<src>` from the database into local file `<dst>`.
+7 -2
View File
@@ -1,3 +1,4 @@
import { displayRev } from "@vrtmrz/livesync-commonlib/compat/common/utils";
import assert from "node:assert/strict";
import { mkdir, readFile, stat, writeFile } from "node:fs/promises";
import { join } from "node:path";
@@ -165,8 +166,12 @@ test(
"--write-settings"
);
assert.notEqual(omittedChunkFetch.code, 0, "Fetch must fail when local-only chunk reads omit the remote chunk");
assert.match(omittedChunkFetch.combined, /useOnlyLocalChunk=true/);
assert.match(omittedChunkFetch.combined, /Could not reconcile/);
assert.ok(
omittedChunkFetch.combined.includes(
`Could not reconcile ${notePath}: content for current database revision ${displayRev(originalRevision)} is unavailable;`
),
omittedChunkFetch.combined
);
assert.deepEqual(
await readFile(receiverNote),
expectedBytes,