Skip unchanged materialization and expire only open occurrences
This commit is contained in:
@@ -44,3 +44,16 @@ test('calendar summaries omit editor payloads and mutation versions cover histor
|
||||
expect((await f.json(`/habits/${habit.id}/days/2026-09-04`)).tasks[0].done).toBe(true);
|
||||
} finally { f.close(); }
|
||||
});
|
||||
|
||||
test('unchanged dashboard and calendar reads write no rows after synchronization', async () => {
|
||||
const f = fixture();
|
||||
try {
|
||||
const habit = await f.json('/habits', 'POST', {name:'Tasks', method:'tasks', tasks:[{name:'Read'}]}, 201);
|
||||
f.setTime('2027-09-04T12:00:00Z');
|
||||
await f.json('/today');
|
||||
const before = (f.sqlite.query('SELECT total_changes() AS n').get() as {n:number}).n;
|
||||
await f.json('/today');
|
||||
await f.json(`/habits/${habit.id}/calendar?from=2027-09-01&to=2027-09-04&compact=true`);
|
||||
expect((f.sqlite.query('SELECT total_changes() AS n').get() as {n:number}).n).toBe(before);
|
||||
} finally {f.close();}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user