fix: resolve unhandled rejections and testnet explorer URL (#420, #421) - #533
Open
Teeeyanaa wants to merge 1 commit into
Open
Conversation
…#420, kellymusk#421) kellymusk#420 — async load() threw on status=0 becoming unhandled rejections - All four pages (wallet, withdraw, transactions, request/[id]) had: if (cause instanceof ApiError && cause.status === 0) throw cause inside an async function called as void load(), so the throw became an unhandled promise rejection. React error boundaries never saw it. - wallet/page.tsx: instead of throwing, setError() is now called, so the page renders an error alert instead of the misleading 'Create payment address' panel during outages. - withdraw/page.tsx: setError() + setBalances([]) so the spinner exits and the form is visible (with 0 balance) with the error above it. - transactions/page.tsx: setError() so the existing ErrorState branch renders with a retry button. - request/[id]/page.tsx: setError() so ErrorState renders on first load; the poll loop continues retrying on subsequent failures, which is the right behaviour for transient network gaps. kellymusk#421 — receipt links hardcoded to testnet; vercel.json used 'MAINNET' - transactions/page.tsx: replaced the hardcoded testnet constant with: const STELLAR_NETWORK = process.env.NEXT_PUBLIC_STELLAR_NETWORK ?? 'TESTNET' const EXPLORER_SEGMENT = STELLAR_NETWORK === 'PUBLIC' ? 'public' : 'testnet' const EXPLORER_BASE = `https://stellar.expert/explorer/${EXPLORER_SEGMENT}/tx` On production (NEXT_PUBLIC_STELLAR_NETWORK=PUBLIC) receipt links now point at the mainnet explorer; local dev falls back to testnet. - vercel.json: corrected 'MAINNET' → 'PUBLIC' in both env and build.env to match the 'PUBLIC' | 'TESTNET' | 'FUTURENET' union in lib/transfer-qr.ts. 'MAINNET' was never a valid value.
|
@Teeeyanaa Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
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.
#420 — async load() threw on status=0 becoming unhandled rejections
#421 — receipt links hardcoded to testnet; vercel.json used 'MAINNET'
https://stellar.expert/explorer/${EXPLORER_SEGMENT}/txOn production (NEXT_PUBLIC_STELLAR_NETWORK=PUBLIC) receipt links now point at the mainnet explorer; local dev falls back to testnet.Summary
Closes #
Type of Change
Changes Made
Testing
npm run dev)npm test)npm test)NEXT_PUBLIC_DEMO_MODE=false)Test steps for reviewers:
Screenshots / Screen Recording
Checklist
Code Quality
npm run lint)anywithout justification):npm run type-checkNEXT_PUBLIC_*variables added to.env.example(if applicable)Observability
captureError/logfromlib/observabilitycaptureErrorlog.*orcaptureErrorSecurity
NEXT_PUBLIC_*variablesAccessibility (UI changes only)
aria-label,aria-describedby)Documentation
SECURITY.mdupdated if the change affects the security surface (rare)Deployment Notes
Related Issues / PRs
closes #420
closes #421