Skip to content
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

Fix payment timing hole #139

Merged
merged 2 commits into from
Apr 8, 2024
Merged

Fix payment timing hole #139

merged 2 commits into from
Apr 8, 2024

Conversation

chuck-dbos
Copy link
Collaborator

The hole was:
/api/create_payment_session was called, starting a workflow, which had not done anything yet really
/api/session_info was called, and found nothing in the database because the workflow hadn't gotten far enough to insert the records yet

The fix was:
Send an event from workflow after DB record was inserted (IRL that ought to have status but I didn't do this)
Wait for it in /api/create_payment_session

That way, the client can't race its call to /api/session_info ahead of the DB insert.

@chuck-dbos chuck-dbos requested a review from devhawk April 8, 2024 18:39
@chuck-dbos chuck-dbos merged commit 1aea065 into main Apr 8, 2024
1 check passed
@chuck-dbos chuck-dbos deleted the chuck/payment_timing_hole branch April 8, 2024 19:26
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