#90: address review — await repair sync before refresh, merge colliding queue markers

This commit is contained in:
2026-08-11 13:06:29 +07:00
parent 8c172e3579
commit e1911554ec
2 changed files with 47 additions and 25 deletions
+4 -3
View File
@@ -516,10 +516,11 @@ test("repairLnwStaleRow merges a duplicate under the repaired key, keeping the f
assert.equal(merged.last_chapter_num, 42); // the stale row is ahead — progress must not be lost
assert.equal(merged.favorite, true); // favourite survives from either row
assert.equal(merged.status, "archived"); // the stronger bucket survives
// One queue marker per key: the repaired-key entry wins, the stale-key one
// is dropped rather than replaying the write twice.
// One marker under the repaired key: sendStatus is sticky (the archive
// intent from the stale-key marker survives) and the worse attempts count
// wins — the queue's own coalescing rules.
assert.deepEqual(out.queue, [
{ key: "lightnovelworld:immortality-simulator", op: "put", sendStatus: false, attempts: 0 },
{ key: "lightnovelworld:immortality-simulator", op: "put", sendStatus: true, attempts: 3 },
]);
});