@@ -61,7 +61,7 @@ import { HttpDelivery, SYS_HTTP_DELIVERY } from './objects/http-delivery.object.
6161import { HttpDispatcher } from './http-dispatcher.js' ;
6262import { hashPartition } from './backoff.js' ;
6363import type { FetchImpl } from './http-sender.js' ;
64- import type { EnqueueHttpInput , HttpClaimCredential , IHttpOutbox } from './http-outbox.js' ;
64+ import type { EnqueueHttpInput , HttpClaimCredential , HttpDelivery as HttpDeliveryRecord , IHttpOutbox } from './http-outbox.js' ;
6565import { installDefaultOrganization } from './default-organization.testkit.js' ;
6666
6767/** The production default. */
@@ -266,6 +266,8 @@ describe('#17623 #28383 HttpDispatcher — idle tick cost', () => {
266266} ) ;
267267
268268describe ( '#29919 SqlHttpOutbox.nextDueAt — the one read a sole-writer loop wakes by' , ( ) => {
269+ const credential = ( d : HttpDeliveryRecord ) : HttpClaimCredential => ( { claimedBy : d . claimedBy ! , claimedAt : d . claimedAt ! } ) ;
270+
269271 it ( 'an empty outbox answers null in TWO statements, both reads' , async ( ) => {
270272 statements = [ ] ;
271273 expect ( await outbox . nextDueAt ( { claimTtlMs : TTL } ) ) . toBeNull ( ) ;
@@ -279,12 +281,12 @@ describe('#29919 SqlHttpOutbox.nextDueAt — the one read a sole-writer loop wak
279281 await outbox . enqueue ( delivery ( 'r_retry' ) ) ;
280282 const claimed = await outbox . claim ( { nodeId : 'node-a' , limit : 10 , claimTtlMs : TTL , now } ) ;
281283 const retry = claimed . find ( ( d ) => d . refId === 'r_retry' ) ! ;
282- await outbox . ack ( retry . id , { success : false , httpStatus : 500 , durationMs : 1 , nextRetryAt : now + 10 * TTL } , retry ) ;
284+ await outbox . ack ( retry . id , { success : false , httpStatus : 500 , durationMs : 1 , nextRetryAt : now + 10 * TTL } , credential ( retry ) ) ;
283285 // r_now is still in flight under node-a, claimed at `now`.
284286 expect ( await outbox . nextDueAt ( { claimTtlMs : TTL , now } ) ) . toBe ( now + TTL + 1 ) ;
285287
286288 const live = claimed . find ( ( d ) => d . refId === 'r_now' ) ! ;
287- await outbox . ack ( live . id , { success : true , httpStatus : 200 , durationMs : 1 } , live ) ;
289+ await outbox . ack ( live . id , { success : true , httpStatus : 200 , durationMs : 1 } , credential ( live ) ) ;
288290 expect ( await outbox . nextDueAt ( { claimTtlMs : TTL , now } ) ) . toBe ( now + 10 * TTL ) ;
289291 } ) ;
290292} ) ;
0 commit comments