@davoodmehraban89 / VELYQOR / commits / d950107
Fork 0

Intelligence, Advanced Charting & Trading Platform

test(notification): ensure ambiguous provider outcome is terminal, non-retried and chronological

davoodmehraban89 committed Oct 21, 2026 at 09:16 UTC d9501070fe6c5d423d47abd836763489f38f2dc7
1 file changed +16
packages/market-domain/test/notification-outbox.test.mjs
+16
@@ -39,3 +39,19 @@ test('reject malformed channels and negative retries',()=>{
39 assert.throws(()=>claimDelivery(fresh(),{now:at(0),leaseMs:-1}));
40 assert.throws(()=>acknowledgeDelivery(fresh(),{at:at(1)}));
41 });
42 +
43 +test('transport timeout after sending has unknown result and never retries',()=>{
44 + let n=claimDelivery(fresh(),{now:at(0)}).record;
45 + n=recordDeliveryOutcome(n,{at:at(1),success:false,unknown:true});
46 + assert.equal(n.status,'UNKNOWN');
47 + assert.equal(n.reason,'OUTCOME_UNKNOWN_RECONCILE_MANUALLY');
48 + assert.equal(n.nextRetryAt,null);
49 + assert.equal(claimDelivery(n,{now:at(20)}).claimed,false);
50 + assert.match(notificationUiStatus(n),/نامشخص/);
51 +});
52 +test('unknown delivery cannot assert success or go backwards in time',()=>{
53 + const n=claimDelivery(fresh(),{now:at(2)}).record;
54 + assert.throws(()=>recordDeliveryOutcome(n,{at:at(3),success:true,unknown:true}));
55 + assert.throws(()=>recordDeliveryOutcome(n,{at:at(1),success:false}));
56 + assert.equal(recordDeliveryOutcome(n,{at:at(3),success:false}).status,'FAILED');
57 +});