Skip to content

Commit 2d31b75

Browse files
committed
test(service-messaging): type the claim credential in the next-due integration pin (#29919)
Claude-Session: https://claude.ai/code/session_01Utp6CY2ugcVZ5KKbTbWpXw Co-authored-by: Claude <noreply@anthropic.com>
1 parent 886c356 commit 2d31b75

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

‎packages/services/service-messaging/src/http-dispatcher-idle-cost.integration.test.ts‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ import { HttpDelivery, SYS_HTTP_DELIVERY } from './objects/http-delivery.object.
6161
import { HttpDispatcher } from './http-dispatcher.js';
6262
import { hashPartition } from './backoff.js';
6363
import 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';
6565
import { installDefaultOrganization } from './default-organization.testkit.js';
6666

6767
/** The production default. */
@@ -266,6 +266,8 @@ describe('#17623 #28383 HttpDispatcher — idle tick cost', () => {
266266
});
267267

268268
describe('#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

Comments
 (0)