fix(lite): surface sync failures instead of a frozen "Syncing 99.9%"; don't report a lost server as "Synced"
Lite-parity audit, sync-progress semantics (state/presentation only — no send/sync backend call changed): - A scan failure set scan->failed + lite_error, but no UI read lite_error, so the user saw "Syncing 99.9%" forever. The status bar now shows the error text on a lite scan/server failure. - After the initial catch-up, a server loss on the cheap probe path (ProbeFailed) left the last "Synced" model on screen. The worker now re-publishes that model demoted (not complete, reason "server unreachable"). - refreshModelImpl's height-read "synced" override no longer fires while syncstatus says the backend is still scanning or is indeterminate, and a server-bound read failure in a full cycle demotes to not-synced. - The syncstatus parser no longer treats a missing/unrecognised "syncing" field as fully synced: it reports an explicit "indeterminate" (not complete). Explicit "false" stays caught-up; the fake backend's syncing:true 1000/1000 behaviour is unchanged. Tests: parser cases for missing/odd/idle "syncing" (testLiteSyncStatus*). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -12006,6 +12006,24 @@ void testLiteSyncStatusParserRealShapes()
|
||||
const auto p = parseLiteSyncStatusResponse(std::string("{\"syncing\":\"true\"}"));
|
||||
EXPECT_FALSE(p.ok);
|
||||
}
|
||||
// Missing or unrecognised "syncing" must NOT default to fully synced.
|
||||
{
|
||||
const auto p = parseLiteSyncStatusResponse(std::string("{}"));
|
||||
EXPECT_TRUE(p.ok);
|
||||
EXPECT_FALSE(p.syncStatus.complete);
|
||||
EXPECT_TRUE(p.syncStatus.indeterminate);
|
||||
EXPECT_NEAR(p.syncStatus.progress, 0.0, 1e-9);
|
||||
const auto q = parseLiteSyncStatusResponse(std::string("{\"syncing\":\"maybe\"}"));
|
||||
EXPECT_TRUE(q.ok);
|
||||
EXPECT_FALSE(q.syncStatus.complete);
|
||||
EXPECT_TRUE(q.syncStatus.indeterminate);
|
||||
}
|
||||
// Explicit idle is still caught-up and determinate.
|
||||
{
|
||||
const auto p = parseLiteSyncStatusResponse(std::string("{\"syncing\":\"false\"}"));
|
||||
EXPECT_TRUE(p.syncStatus.complete);
|
||||
EXPECT_FALSE(p.syncStatus.indeterminate);
|
||||
}
|
||||
}
|
||||
|
||||
// Per-address balances: unspent notes/utxos are summed per address (spent ones excluded)
|
||||
|
||||
Reference in New Issue
Block a user