Repository navigation
fix(purchase): preserve ramp progress across stale plan updates - #464
Merged
Merged
Conversation
Use a plan-specific monotonic timestamp trigger so optimistic writers can distinguish updates within one transaction and clock regressions.
Use the persisted update token for plan edits and locked ramp writers. Return conflicts without replacing completed progress, and stamp sent notifications without replaying an older plan snapshot.
Contributor
|
Warning Review limit reached
This review includes 19 billable files and costs up to $4.75.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Or wait 50 minutes for your next included review. View limit detailsLimit details: You’ve used the included review currently available. Your 83 included PR review attempts over the past 7 days set your current allowance at 1 review per hour. Review configuration: ⚙️ Run configuration
📒 Files selected for processing (19)
Comment |
This was referenced Oct 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A notification sweep could restore a stale ramp step after an approval completed the next step, stopping further ramp purchases. Plan updates now reject stale snapshots, and notification stamping updates only its own field. A plan-specific trigger makes version timestamps advance even for repeated writes in the same transaction.
Closes #230.
Independent adversarial
gpt-6-astrareview approved exact commit5c5e1fea5e3ad24e02c52b8d13bd7d2af3afae35with no actionable findings, using the owner's authorized local-review alternative. The reviewer reread all 19 changed files and independently reproduced the original failures and targeted mutations.Connected tests exercise the real notification sweep, PostgreSQL store and migrations, completion, next-execution creation and step-3 continuation. Stale PUT, PATCH and disable requests return sanitized HTTP 409 while distinct fresh edits succeed. Store tests cover notification-token invalidation, missing versus stale rows, rollback, failed commits and database errors. Existing PostgreSQL 16 container fixtures and separately labeled native PostgreSQL 17 checks passed. Independent final-SHA race tests, backend build and normal commit hooks passed; the author also passed the full race suite with synthetic AWS credentials, empty configuration files, metadata disabled and verified closed loopback endpoints.
Negative controls independently restored the old timestamp trigger, removed the version check and restored the full-row notification writer. Each failed its intended assertions; fresh-edit controls continued to pass where applicable.
The initial broad suite used an existing AWS resolver test that could attempt reads with ambient credentials. That run does not establish offline execution; the final isolated rerun passed. Connected issue230 probes mock external email and authentication boundaries and use synthetic database data. No purchase, email delivery or deployment was performed for verification.
The schema and application change belong in one rollout. This fix protects persisted plan progress; it does not promise exactly-once notification delivery. Size exception approved for one coherent concern: production plus migrations 71 additions/50 deletions, tests and mock support 402 additions/37 deletions.