Skip to content

Hosted: drop the clock-skew allowance from account closure's hold - #1925

Merged
nedtwigg merged 1 commit into
mainfrom
audit-closure-skew
Nov 30, 2026
Merged

nedtwigg merged 1 commit into
mainfrom
audit-closure-skew

Conversation

@nedtwigg

Copy link
Copy Markdown
Member

Account closure records the subscriptions an attempt is canceling, with a deadline (cancelingBy) set 15 minutes past the attempt's start. A later attempt drops any recorded subscription that ended after that deadline, since it lapsed for some other reason. The code added another five minutes for clock skew between Stripe and the Worker before dropping one.

An attempt cancels within seconds of its start, so the 15-minute hold already absorbs any plausible skew. This removes the extra allowance, making the code match the closure rule in docs/specs/security-hosted.md exactly, and updates the rationale entry that cited it.

server/tests/billing-routes.test.ts passes (66/66).

🤖 Generated with Claude Code

A closure attempt cancels within seconds of its start, and the hold's
`cancelingBy` sits 15 minutes past that start, so the extra five minutes
added nothing and left the code looser than the closure rule it follows.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying mouseterm with  Cloudflare Pages  Cloudflare Pages

Latest commit: 64b5fb2
Status: ✅  Deploy successful!
Preview URL: https://e8aabb96.mouseterm.pages.dev
Branch Preview URL: https://audit-closure-skew.mouseterm.pages.dev

View logs

@nedtwigg
nedtwigg merged commit 9fd01aa into main Nov 30, 2026
14 checks passed
@nedtwigg
nedtwigg deleted the audit-closure-skew branch November 30, 2026 09:09
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