fix(webhooks): write delivery timestamps as ISO strings
Applies the repo's documented Jest+SQLite guidance (CLAUDE.md) to the webhook delivery path, which was the last one still passing raw Date objects into knex writes. Under jest those store as the literal string "[object Object]", so next_retry_at came back NaN and the retry/backoff test could not assert on it. Production (PG, and SQLite outside jest) was unaffected. Convert the timestamp writes -- and the `next_retry_at <=` due comparison, which has to stay type-consistent with them -- to .toISOString(), matching the existing precedent in downloadJobService.js. Refs testplan REPORT.md #22 (Part 1.2.01).
This commit is contained in:
@@ -146,8 +146,8 @@ describe('webhook delivery worker (#327)', () => {
|
||||
payload: JSON.stringify({ id: 'd1', type: 'event.published', data: {} }),
|
||||
attempt_count: 4,
|
||||
status: 'pending',
|
||||
next_retry_at: new Date(),
|
||||
created_at: new Date(),
|
||||
next_retry_at: new Date().toISOString(),
|
||||
created_at: new Date().toISOString(),
|
||||
});
|
||||
await __test.tick();
|
||||
|
||||
@@ -190,8 +190,8 @@ describe('webhook delivery worker (#327)', () => {
|
||||
payload: JSON.stringify({ id: 'd1', type: 'event.published', data: {} }),
|
||||
attempt_count: 0,
|
||||
status: 'pending',
|
||||
next_retry_at: new Date(),
|
||||
created_at: new Date(),
|
||||
next_retry_at: new Date().toISOString(),
|
||||
created_at: new Date().toISOString(),
|
||||
});
|
||||
await __test.tick();
|
||||
|
||||
@@ -214,8 +214,8 @@ describe('webhook delivery worker (#327)', () => {
|
||||
payload: JSON.stringify({ id: 'd1', type: 'event.published', data: {} }),
|
||||
attempt_count: 0,
|
||||
status: 'pending',
|
||||
next_retry_at: new Date(),
|
||||
created_at: new Date(),
|
||||
next_retry_at: new Date().toISOString(),
|
||||
created_at: new Date().toISOString(),
|
||||
});
|
||||
await __test.tick();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user