Overage modal - race condition + caching results in no modal
Problem
Discovered in: gitlab#423043 (comment 1532717104)
With gitlab!128679 (merged) we started checking that reconciliations were enabled before displaying the overage modal. We did this by reusing GitlabSubscriptions::Reconciliations::CheckSeatUsageAlertEligibilityService
. However, this service is used in other places, which results in a race condition when purchasing a new subscription.
Steps to reproduce:
- [Gitlab] Purchase a new subscription
- [Gitlab] In rails console
GitlabSubscriptions::Reconciliations::CheckSeatUsageAlertsEligibilityService.new(namespace: namespace).execute
- Notice the result is false, and will continue to be false for one day.
This is because this service is used in the billings controller index action which is called immediately after purchasing the subscription before the subscription has time to fully propagate.
Proposal
Update GitlabSubscriptions::Reconciliations::CheckSeatUsageAlertsEligibilityService
to not cache nil values.
Result
Next steps (if any)
How will we measure success?
Edited by Ryan Cobb