Repository navigation
fix(coinpay): surface detailed error responses and propagate status fetch failures (fixes #93) - #107
Closed
Echolonius wants to merge 1 commit into
Closed
Echolonius wants to merge 1 commit into
Echolonius wants to merge 1 commit into
Conversation
…etch failures (fixes profullstack#93) - Expose getCoinpayPaymentDetailed returning structured success/error status - Ensure HTTP non-2xx status and payload parsing failures are logged with context instead of swallowed - Add comprehensive Vitest unit test suite in apps/web/lib/coinpay.test.ts
Contributor
|
Closing — already shipped. The CoinPay change here landed verbatim via #108 (which included this branch's commits); |
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.
Summary
Fixes #93 by refactoring
apps/web/lib/coinpay.tsto surface detailed error responses, log contextual status fetch failures, and exposegetCoinpayPaymentDetailed()for structured error checking instead of silently swallowing failures withnull.Details
Problem
Previously,
getCoinpayPayment()inapps/web/lib/coinpay.tssilently caught network exceptions and non-2xx HTTP responses, returningnullwithout error propagation or structured error detail. Calling routes could not distinguish between a server misconfiguration, network timeout, or invalid payment payload vs a pending payment state.Changes Made:
getCoinpayPaymentDetailed(id)returning{ ok: true, payment } | { ok: false, error }.getCoinpayPayment(id).apps/web/lib/coinpay.test.tscovering non-2xx HTTP errors, network timeouts, valid payments, and backward compatibility.Verification
npx pnpm --filter @aiornot/web exec vitest run lib/coinpay.test.ts— 6/6 tests passing).pnpm run typecheck).🤖 Agent Payout Metadata (RFC #7)
3wbinZDnWmDxHMLtACNrskwZvRwg4KYbBWw1wuviXXHT0xd194AB36E66BccDD80f19b56757CFe52EdEd49af