test(sync): pin the write-back of remapped outbox entries
Refs #165 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
0317d15266
commit
532b628887
1 changed files with 2 additions and 0 deletions
|
|
@ -269,6 +269,8 @@ check('writes made during the first sync are queued and follow the server Inbox
|
|||
const remap = merge.indexOf('await db.update(tasks).set({ listId: serverInboxId }).where(eq(tasks.listId, INBOX_ID));');
|
||||
const pending = merge.indexOf('remapInboxEntry(entry, serverInboxId)');
|
||||
assert.ok(remap >= 0 && pending > remap, 'the pending entries follow the server Inbox after the local remap');
|
||||
assert.match(merge, /const remapped = remapInboxEntry\(entry, serverInboxId\);\s*if \(remapped\) await db\.update\(syncOutbox\)\.set\(remapped\)\.where\(eq\(syncOutbox\.id, entry\.id\)\);/, 'the remapped entry is written back');
|
||||
assert.match(merge, /const pending = await db\.select\(\)\.from\(syncOutbox\)\.where\(isNull\(syncOutbox\.syncedAt\)\);\s*for \(const entry of pending\) \{/, 'every unsent entry is remapped');
|
||||
});
|
||||
|
||||
// No merge across accounts (#165). firstSyncChoice and canSync are executed
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue