Skip to content

fix(subscription-service): Fix potential race condition #4117

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 8, 2025

Conversation

ivannovosad
Copy link
Contributor

@ivannovosad ivannovosad commented Aug 8, 2025

Context

There is a potential race condition when terminating a subscription. This job is called before invoice is created (transaction is not committed yet):

GeneratePdfAndNotifyJob.perform_later(invoice:, email: should_deliver_finalized_email?)

Description

Call all the webhooks and other dependent jobs after_commit.

Copy link
Contributor

@ancorcruz ancorcruz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@ivannovosad ivannovosad merged commit 4206a63 into main Aug 8, 2025
14 checks passed
@ivannovosad ivannovosad deleted the fix-subscription-service branch August 8, 2025 12:34
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