Block multiple subscription updates
Problem
The frontend can send multiple requests to PUT /subscriptions/:subscription_id/update
or POST /subscriptions
in certain flows. This can cause lock errors in Zuora and I imagine inconsistent behavior on the frontend since we are dependent on the order in which the requests finish.
This is likely causing some of the flakiness we've been seeing in specs:
Here are some of the effected flows I've identified so far:
Add more seats flow
Storage
Compute minutes
Community coupon renewal flow
Proposal
- Wait until the request has finished before allowing a new request.
How to recreate
- Put a
binding.pry
orsleep 10
inSubscriptionController#create
orSubscriptionController#update
(depending on flow) to mimic a slow response.
Edited by Ryan Cobb