Skip to content

fix(deposits): a failed pricing-request lookup no longer creates a ticket-level draft - #1191

Merged
waritctd merged 1 commit into
developfrom
fix/release-review-2026-10-29
Oct 29, 2026
Merged

waritctd merged 1 commit into
developfrom
fix/release-review-2026-10-29

Conversation

@waritctd

Copy link
Copy Markdown
Owner

This is the fix for finding 2 from the code review of the release PR #1190.

Before this change, createDepositNoticeDraft swallowed a failed api.pricingRequests.listForTicket and fell through to api.depositNotices.createDraft. So a brief network error on a pricing-request deal created the deposit notice from the ticket-level route instead of from the accepted quotation. Now the error propagates: the caller's onError shows the toast and nothing is created.

Findings 1 and 3 needed no change:

  • 1, auto-cancel event kind: the auto-cancel logs the same CANCELLED kind that DealQuotationService.cancel already uses when a single quotation is cancelled, and nothing reads that kind as "the deal was cancelled".
  • 3, issued remaining invoice pointing at a replaced deposit notice: this can't happen. A deposit notice only ever goes from DRAFT to ISSUED, and only one can be issued per deal.

Tests (written first, shown red)

  • DepositNoticePage.test.jsx: the existing test "falls back to the ticket-level route when resolving pricing requests fails" is rewritten as "surfaces the error and creates nothing when resolving pricing requests fails". It checks that the error toast is shown, and that neither createDraft nor createDepositNoticeFromQuotation is called.
    • Before the fix it failed with expected "vi.fn()" to be called with arguments: [ 'error', 'network error' ].
  • The existing tests for the other two routes still pass: an accepted pricing request goes to createDepositNoticeFromQuotation, and a deal with no accepted request goes to createDraft.
  • Not covered: the deal page's main button, which uses the same helper and the same onError. It has no separate test for this.

Targeted run: src/features/deposits and TicketDetailPage.test.jsx, 215 tests pass. eslint is clean.

🤖 Generated with Claude Code

@vercel

vercel Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
demo-glr Ready Ready Preview Oct 29, 2026 3:17am UTC

Request Review

…cket-level draft

createDepositNoticeDraft swallowed a failed listForTicket and fell through to
the ticket-level createDraft, so a network blip on a PCR deal built the
deposit notice from the wrong source. The error now propagates: the caller's
onError shows it and nothing is created. A deal with no pricing requests still
takes the ticket-level route. (Release review of #1190, 2026-10-29.)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@waritctd
waritctd force-pushed the fix/release-review-2026-10-29 branch from ac5309a to 6c13ec6 Compare October 29, 2026 03:17
@waritctd
waritctd merged commit 24318c3 into develop Oct 29, 2026
7 checks passed

This branch was successfully deployed

1 active deployment
Preview — 6c13ec66 Deployed Oct 29, 2026 by vercel[bot]
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.

1 participant