Conversation
The logs endpoint paginated webhook_logs without an ORDER BY and only sorted the returned page in PHP, so once a webhook had more than ten logs the modal showed an arbitrary ten rows. Order by id in the query so the ten most recent deliveries are returned.
This branch has not been deployed
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.
What changes I've made
GetWebhookLogsHandlernow fetches the logs withfindWhere(..., orderAndDirections: [id desc], limit: 10)instead ofpaginateWhere(..., limit: 10), and returns aCollection.sortByfromGetWebhookLogsActionandGetOrganizerWebhookLogsAction, since the query now returns the rows in the right order.GetWebhookLogsHandlerTest.The response shape is unchanged: both actions already turned the paginator into a plain collection via
sortBy, so the endpoint never returned pagination meta, and the frontend expectsGenericDataResponse<WebhookLog[]>.Why I've made these changes
The webhook logs modal can get stuck showing old deliveries while newer ones are hidden.
paginateWhereapplies noORDER BY, so the endpoint returned an arbitrary ten rows, and the action only sorted those ten afterwards.deleteOldLogskeeps the 20 most recent logs per webhook, so once a webhook has more than ten logs, which ten are shown is up to the database.I hit this on a self-hosted instance (PostgreSQL): the modal showed ten deliveries that were 9–10 days old, while the webhook row itself said "last triggered an hour ago" with a 422. Requesting
?page=2on the logs endpoint returned the ten newest logs, including the failed one, but the UI has no way to get there. That made a failing delivery impossible to inspect from the dashboard.I kept the limit at ten to keep the change minimal. Showing all 20 retained logs would also be reasonable; happy to change that if you prefer.
I did not open an issue first because this is a small, self-contained bug fix. I'm happy to open one if you would rather track it that way.
How I've tested these changes
GetWebhookLogsHandlerTestasserts that the logs are requested ordered byiddescending with a limit of ten, that the webhook lookup is scoped to the event or organizer, and that a missing webhook throws. It fails against the previous handler and passes with the fix.phpunit --testsuite=Unitpasses locally (1260 tests), as doestests/Feature/OpenApi.pint --testpasses on the changed files.Checklist
🤖 Generated with Claude Code