Webhook event replay re deliver past events by time range#414
Open
clintjeff2 wants to merge 2 commits into
Open
Webhook event replay re deliver past events by time range#414clintjeff2 wants to merge 2 commits into
clintjeff2 wants to merge 2 commits into
Conversation
Add webhook event replay endpoint
|
Contributor
Author
|
@leocagli, review and merge. |
3 similar comments
Contributor
Author
|
@leocagli, review and merge. |
Contributor
Author
|
@leocagli, review and merge. |
Contributor
Author
|
@leocagli, review and merge. |
Contributor
Author
|
@leocagli, please review and merge. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Motivation
eventsand reuse the existing delivery path.Description
globalThis.__openStellarEventLog__) capped at 500 entries and helper APIslistPublishedSystemEvents()andresetPublishedSystemEventLogForTests()inlib/events/system-events.ts.replayEventsToWebhook(webhookId, from, to)inlib/webhooks/delivery.tswhich looks up the webhook, filters the persisted events byoccurredAtwindow and webhookevents, and calls the existingdeliverToWebhook()for each match.POST /api/webhooks/[id]/replayatapp/api/webhooks/[id]/replay/route.tswith strict ISO timestamp validation forfrom/to,from <= tochecks, returns{ ok: true, queued: number }, and returns 404 when the webhook is not found.app/api/openapi.json/route.tsand add unit tests in__tests__/api/webhooks.test.tscovering zero-event replay, type-filtered replay, full-window replay, unknown webhook 404, and ring-buffer eviction behavior.Testing
vitestfor__tests__/api/webhooks.test.tsand__tests__/api/openapi.test.ts— both test files passed.npm run lintreported pre-existing unrelated issues in other files.npm run build— failed in this environment due to Next.js failing to fetch Google Fonts (unrelated to these changes).Closes #245