Skip to content

fix: return 200 response for unused handlers#6

Open
janvennemann wants to merge 2 commits into
bmorrisondev:mainfrom
janvennemann:patch-1
Open

fix: return 200 response for unused handlers#6
janvennemann wants to merge 2 commits into
bmorrisondev:mainfrom
janvennemann:patch-1

Conversation

@janvennemann
Copy link
Copy Markdown

We are using this package but only require one of the handlers currently. For all other events this package currently return a 404 error. This will cause Clerk to repeatedly retry the event, although we are not interested in it. It will also mark a lot of request as failed.

To avoid unnecessary retries this package should not return an error response in case the event isn't handled.

@bmorrisondev
Copy link
Copy Markdown
Owner

Hey @janvennemann thanks for submitting this. I'd argue that the other events should be disabled in the Clerk dashboard if there is no intention to handle them. The reason I opted to return a non-success code on unconfigured events is to prevent false successes in the dashboard. If an event is enabled in the Clerk dashboard, but not configured in the handler, it will still show that the message was processed successfully in the dashboard even if nothing is being done with it.

@janvennemann
Copy link
Copy Markdown
Author

Thanks, that makes total sense. Someone else did the initial setup in the project so i didn't know about that feature in the Clerks dashboard. After updating the subscribed events for the webhook everything works flawlessly. You can close this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants