mirror of
https://github.com/vrtmrz/obsidian-livesync.git
synced 2026-05-14 03:21:17 +00:00
test(cli): add TODO comment and locked-remote-DB test script
- Add inline TODO comment in runCommand.ts about standardising
replication failure cause identification logic.
- Add test-sync-locked-remote-linux.sh that verifies:
1. sync succeeds when the remote milestone is not locked.
2. sync fails with an actionable error when the remote milestone
has locked=true and accepted_nodes is empty.
This commit is contained in:
@@ -22,6 +22,9 @@ export async function runCommand(options: CLIOptions, context: CLICommandContext
|
||||
console.log("[Command] sync");
|
||||
const result = await core.services.replication.replicate(true);
|
||||
if (!result) {
|
||||
// TODO: Standardise the logic for identifying the cause of replication
|
||||
// failure so that every reason (locked DB, version mismatch, network
|
||||
// error, etc.) is surfaced with a CLI-specific actionable message.
|
||||
const replicator = core.services.replicator.getActiveReplicator();
|
||||
if (replicator?.remoteLockedAndDeviceNotAccepted) {
|
||||
console.error(
|
||||
|
||||
Reference in New Issue
Block a user