Skip to content
This repository has been archived by the owner on Oct 5, 2022. It is now read-only.

Added cleanup on startup for old webhooks #181

Merged
merged 1 commit into from
Jul 20, 2020

Conversation

allouis
Copy link
Collaborator

@allouis allouis commented Jul 20, 2020

no-issue

Due to a bug in Ghost webhooks are now created with a trailing "/" which
meant that the previous webhooks to that (without a slash) was never
removed.

This results in users receiving emails from stripe about failed webhook
delivery, which is not good at all.

This fix lists out the webhooks and finds (if present) the webhook which
matches the current URL, minus the trailing slash. If found it will then
attempt to delete that webhook thus stopping the emails from Stripe.

I've added a note to remove this code as it should only ever need to run
once, and can be removed for the Ghost release after these changes.

@allouis allouis force-pushed the cleanup-old-webhooks branch 2 times, most recently from 790fa0a to 2664b60 Compare July 20, 2020 10:44
closes TryGhost/Ghost#12061

Due to a bug in Ghost webhooks are now created with a trailing "/" which
meant that the previous webhooks to that (without a slash) was never
removed.

This results in users receiving emails from stripe about failed webhook
delivery, which is not good at all.

This fix lists out the webhooks and finds (if present) the webhook which
matches the current URL, minus the trailing slash. If found it will then
attempt to delete that webhook thus stopping the emails from Stripe.

I've added a note to remove this code as it should only ever need to run
once, and can be removed for the Ghost release after these changes.
@allouis
Copy link
Collaborator Author

allouis commented Jul 20, 2020

Hey @rishabhgrg can you give this a double check that it makes sense to you?

@allouis allouis merged commit 017f1ac into TryGhost:master Jul 20, 2020
@allouis allouis deleted the cleanup-old-webhooks branch July 20, 2020 15:54
allouis added a commit to allouis/Ghost that referenced this pull request Jul 21, 2020
allouis added a commit to TryGhost/Ghost that referenced this pull request Jul 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants