fix(console): account for partial Zen refunds - #34227
Conversation
Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com>
|
Merge review result: not merging yet. Validation/status checked:
Merge blockers:
Suggested fix: persist the refunded amount already accounted for, or process individual refund events with refund-id idempotency, then deduct only the new delta: Reference docs:
|
|
Merge review result: still not merging. Validation evidence from a fresh isolated worktree on current
Merge blockers remain:
Needed before merge: store or ledger the already-accounted refunded amount/refund IDs, deduct only the new refund delta up to |
|
Merge review refresh for task 95480452: still not merging. Current state checked on 2026-06-28:
Merge blockers remain:
Needed before merge: persist the already-accounted refunded amount or process refund IDs idempotently, deduct only the new delta up to the original payment amount, represent partial vs full refunds accurately, and add targeted tests for duplicate events, first partial refund, sequential partial refunds, and full refund idempotency. Existing follow-up task: |
|
Merge review refresh for task 99f73a07: not merging. Current state checked on 2026-06-28 at 13:52 +03:00:
Merge blockers remain:
Needed before merge: persist the already-accounted refunded amount or process refund IDs idempotently, deduct only the new delta up to the original payment amount, avoid treating partial refunds as full refunds, and add targeted tests for duplicate events, first partial refund, sequential partial refunds, and full-after-partial refund capping. |
|
Merge review refresh for task ce74ef35: not merging. Current state checked on 2026-07-05 15:49 EEST:
Merge blockers remain:
Needed before merge: persist accounted refunded amount or refund IDs for idempotency, deduct only the new refund delta capped by the original payment amount, avoid treating partial refunds as full refunds, add targeted tests for duplicate events, first partial refund, sequential partial refunds, and full-after-partial refund capping, then mark ready for review and get review approval. |
|
Automated PR Cleanup Thank you for contributing to opencode. Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions. This PR was closed because it matched the following cleanup criteria:
PRs created within the last month are not affected by this cleanup. If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate. Thanks again for taking the time to contribute. |
Summary
charge.refundedwebhook deduct the actual refunded amount instead of always deducting the original top-up amountpayment.time_refunded is null, so webhook retries do not double-deductValidation
bun run typecheckfrompackages/console/appNote: local
git pushpre-push hook runs full monorepobun turbo typecheck; that failed outside this change in@opencode-ai/serverviapackages/core/src/tool/{apply-patch,edit}.tsmissingdifftype declarations. Branch was pushed withHUSKY=0after the targeted Console app typecheck passed.