A subscription reconcile's Stripe calls ignore the caller's deadline #285
Closed
opened 2026-10-29 05:03:49 +00:00 by cgalo5758
·
1 comment
Labels
Clear labels
accessibility
area/billing
area/catalog
area/discourse
area/domains
area/entitlements
area/fedwiki
area/identity
area/integrations
area/licensing
area/member-ui
area/meta
area/operator-ui
area/ops
area/testing
duplicate
good-first-issue
invalid
privacy
security
upstream
wontfix
A barrier for people using assistive technology or a keyboard alone.
The Stripe mirror, checkout, subscriptions, invoices, fulfillment.
Products, prices, plan ladders, purchasability.
The Discourse integration.
The domains registry, claims, placements, the certificate ask.
Entitlement sets, rules, grants, pools, provisioning.
The Federated Wiki integration and farm sync.
Sign-in, sessions, persons, organizations, workspaces, roles.
The provider registry, outbox and webhooks in general.
Licenses, the contributor agreement, SPDX headers.
Member pages.
The repository itself, its contributing guide, CI, the tracker and the workflow.
Operator pages, forms, lists, the design system.
Deployment, configuration, migrations, workflows, instance settings.
The test stack, screens, lint, walkthroughs.
Closed because another issue already covers it.
Small, self-contained, and explained enough to be a first contribution.
Closed because it is not a ticket for this repository.
Touches what a person's data reveals.
Touches authentication, authorization, secrets or data exposure.
Waits on another repository or project before it can move.
Closed because it will not be done, with the reason in the last comment.
kind
bug
The software does something other than what it promises; closed when it again does what it promises.
kind
debt
Code, tests or tooling to clean up with nothing visible changing; closed when they are cleaner.
kind
design
A question to settle before work can be defined; closed when the decision is written down.
kind
docs
Documentation that is wrong or missing; closed when it says the right thing.
kind
enhancement
Something the software does not do yet; closed when it does.
priority
critical
Blocks the active milestone or harms members now.
priority
high
Next in line inside the active milestone.
priority
low
Inside the active milestone, when nothing else is left.
priority
medium
Inside the active milestone, after the high ones.
Milestone
No items
No Milestone
Public launch
Projects
Clear projects
No projects
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: wiki-cafe/member-console#285
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
What happens
The subscription reconcile, which brings the console's record of a subscription in line with Stripe, reads the subscription from Stripe and may pause or clear its payment collection and release a spent schedule. None of these three calls carries a context. Each one therefore runs under stripe-go's defaults, an 80-second timeout and two retries, so about four minutes, whatever deadline its caller set. The webhook's one-minute attempt and the outbox's two-minute attempt bound the reconcile's database work, but neither bound reaches these calls.
What should happen
Each of the three calls carries the reconcile's context, and a test reads, through the Stripe mock, the deadline each call carried. A reconcile whose context ends then fails at its read from Stripe, as it already fails at its transaction.
Where
fetchSubscription(internal/fulfillment/reconcile.go),applyCollectionAction(internal/fulfillment/collection.go), and the release inreleaseSpentSchedule(internal/fulfillment/reconcile.go)Why it matters
A caller's time bound does not hold, and the switch of a paused subscription (#278) needs its restore of the pause bounded, so that a renewal cannot finalize while the subscription is unpaused.
The subscription reconcile is the step that reads a subscription from Stripe and brings the console's records and entitlements in line with it. Each Stripe call it makes now carries its caller's context, so the call ends when the caller's deadline passes or the caller is cancelled, instead of running under the Stripe library's own 80-second timeout and two retries. Its calls are the read of the subscription, the release of a subscription schedule the console attached that has nothing left to do, the pause or clear of the subscription's payment collection made from the outbox (the console's queue of Stripe actions, retried in the background), and the list of a customer's latest subscription with which the checkout return (the dashboard a member lands on after paying at Stripe) starts. A webhook event's reconcile now ends with its one-minute attempt, an outbox entry's with its two-minute attempt, a member's plan change with the request's 32 seconds, and the checkout return's after its five seconds. A reconcile whose context has already ended fails at the read and writes nothing. A release or a collection change that a deadline cuts may still have reached Stripe; the next reconcile reads the subscription again and either finds the change made or makes it again. Tests read, through the Stripe mock, the deadline each call carried.
Commit:
84709d96