Keep unsent notification batches pending and retain seen history

This commit is contained in:
2026-09-06 13:00:12 +03:00
parent d2d66c8e9d
commit 4c4ba0c4c8
5 changed files with 82 additions and 23 deletions
+8
View File
@@ -26,3 +26,11 @@ test('distinct topic and institution sets coexist while equivalent subscriptions
subscriptions.subscribe('sets',{konular:['Laboratuvar','TEST'],kurumlar:['Hastane B']});
rows=subscriptions.list('sets');assert.equal(rows.length,3);assert.equal(rows.find(row=>row.id===one.id).sonGorulenler[0],'tender-1');
});
test('baseline does not claim delivery and seen history is not truncated at 400',()=>{
const row=subscriptions.subscribe('history',{konular:['Laboratuvar']})[0];
subscriptions.markBaseline(row.id,Array.from({length:450},(_,i)=>'old-'+i));
let saved=subscriptions.list('history')[0];assert.equal(saved.initialized,true);assert.equal(saved.sonGonderim,null);assert.equal(saved.sonGorulenler.length,450);
subscriptions.markSent(row.id,['new-1','old-1']);saved=subscriptions.list('history')[0];
assert.equal(saved.sonGorulenler.length,451);assert.ok(saved.sonGonderim);assert.ok(saved.sonGorulenler.includes('old-0'));
});