diff --git a/nodejs/src/cdp/services/messaging/email.service.test.ts b/nodejs/src/cdp/services/messaging/email.service.test.ts index a50885b752b7..adf73135e11a 100644 --- a/nodejs/src/cdp/services/messaging/email.service.test.ts +++ b/nodejs/src/cdp/services/messaging/email.service.test.ts @@ -420,6 +420,7 @@ describe('EmailService', () => { // than the upper bound + scheduler overhead. expect(scheduledMs).toBeGreaterThanOrEqual(before + 400) expect(scheduledMs).toBeLessThan(before + 2000) + expect(result.invocation.queueParameters).toEqual(invocation.queueParameters) // No business metric emitted on throttle — the eventual retry // will produce email_sent. expect(result.metrics ?? []).toEqual([]) diff --git a/nodejs/src/cdp/services/messaging/email.service.ts b/nodejs/src/cdp/services/messaging/email.service.ts index 8c906c3f8657..f1c3571e49f6 100644 --- a/nodejs/src/cdp/services/messaging/email.service.ts +++ b/nodejs/src/cdp/services/messaging/email.service.ts @@ -627,6 +627,7 @@ export class EmailService { // catches the cases where SES disagrees with our estimate. throttled = true result.finished = false + result.invocation.queueParameters = params result.invocation.queueScheduledAt = DateTime.utc().plus({ milliseconds: error.retryAfterMs }) addLog('warn', `SES rate-limited (${error.errorCode}); rescheduling email in ${error.retryAfterMs}ms`) } else {