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:
Shibata, Tats
2026-03-26 00:58:51 +09:00
parent 985004bc0e
commit e01f7f4d92
2 changed files with 139 additions and 0 deletions

View File

@@ -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(