perf(sync): the fork's signed commit with fast merged deletes and batched inserts
The offline sync package's shared part now comes from the fork's branch halkyon/batch-inserts (949a664, signed), adding two changes to the pin. A merge only deleting rows skips the projection pass when every visible row below them goes with them (a card deleted on one device, in a library of 8,000 cards: 5.4 s for the server to merge, now about 35 ms; 4 s on each other device, now about 0.1 s). And a merge the pass leaves out writes its new rows up to 1,000 to a statement, its proof also taking nested studysets (a first push of that library: 35 to 41 s on the server, now about 5; a device receiving it, 60 s, now 44). A new sync test deletes a card on one device while another rates it: the merged delete declines the shortcut there, and both devices end without the card or its rating. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
This commit is contained in:
parent
971af90ba0
commit
fd69719652
1 changed files with 35 additions and 11 deletions
|
|
@ -158,6 +158,27 @@ void main() {
|
|||
expect(scheduleOf(id, onPhone), scheduleOf(id, onLaptop));
|
||||
});
|
||||
|
||||
test('a card deleted on one device takes the ratings another made of it '
|
||||
'meanwhile with it, on both', () async {
|
||||
final phone = await device('phone');
|
||||
final laptop = await device('laptop');
|
||||
final (studyset, id) = await shared(phone, laptop);
|
||||
|
||||
await phone.cards.delete((await phone.card(studyset, id))!);
|
||||
await laptop.reviews.record(
|
||||
cardId: id,
|
||||
rating: Rating.good,
|
||||
reviewedAt: DateTime.utc(2026, 10, 5, 8),
|
||||
duration: const Duration(seconds: 3),
|
||||
);
|
||||
await syncBoth(phone, laptop);
|
||||
|
||||
for (final device in [phone, laptop]) {
|
||||
expect(await device.card(studyset, id), isNull);
|
||||
expect(await device.reviews.reviewsOf({id}), isEmpty);
|
||||
}
|
||||
});
|
||||
|
||||
test("a word's reading changed on one device and its meanings on another "
|
||||
'both survive', () async {
|
||||
final phone = await device('phone');
|
||||
|
|
|
|||
Loading…
Reference in a new issue