fix(kobo): trust a confirmed replacement for positions and annotations

A replacement stayed ambiguous after the user confirmed it, so every
position the Kobo sent was discarded and annotation pulls failed with 409.
Confirming now makes it the device's copy and moves the stored bookmark
onto it. It still cannot drag saved progress backwards, and that is
judged by position, since its percentages run on a different scale.

Ref #1786
This commit is contained in:
neon
2026-10-17 00:45:21 +00:00
parent 27edb5e25c
commit 60ad70ff5c
11 changed files with 244 additions and 51 deletions
+2 -1
View File
@@ -550,7 +550,8 @@ describe('Read-aloud delivery contracts (e2e)', { timeout: 180_000 }, () => {
where: and(eq(schema.koboDeviceReadingStates.deviceId, device.id), eq(schema.koboDeviceReadingStates.bookId, book.bookId)),
});
expect(raw?.currentBookmark).toMatchObject({ ProgressPercent: 0 });
expect(raw?.deliveryId).not.toBe(replacement.id);
if (stage === 'user_confirmed') expect(raw?.deliveryId).toBe(replacement.id);
else expect(raw?.deliveryId).not.toBe(replacement.id);
const pulled = await (await http('GET', devicePath(device, `library/${book.bookId}/state`), undefined, false)).json();
expect(pulled[0].CurrentBookmark.ProgressPercent).toBe(61);
expect(pulled[0].StatusInfo.Status).toBe('Reading');