Repository navigation
fix: shared error helper, wallet errors, token cleanup and timeout coverage (#226, #227, #230, #232) - #348
Merged
presidojay1 merged 4 commits intoOct 20, 2026
Conversation
Each page repeated `err instanceof ApiError ? err.message : fallback`. Add getErrorMessage(err, fallback) to lib/api and use it on every page. It also surfaces WalletError messages, replacing actionErrorMessage, so a rejected wallet signature shows its message on each My tickets action. Refs StellarTickets#230, StellarTickets#232
A rejected Freighter signature on transfer, list and cancel should show the wallet's own message instead of a generic failure. Refs StellarTickets#232
Assert that a 401 from /users/me removes the stored token, and that other failures such as a 500 keep it. Refs StellarTickets#226
Match the acceptance criterion on StellarTickets#227 so the timeout path is covered at the boundary the issue names. Refs StellarTickets#227
|
@medunrebecca-dot 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! 🚀 |
❌ Deploy Preview for stellartickets failed.
|
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
Closes #226
Closes #227
Closes #230
Closes #232
getErrorMessage(err, fallback)tolib/api.tsand uses it on every page in place of the inlineerr instanceof ApiError ? err.message : fallbackternary. It replacesactionErrorMessage, which is removed, and also surfacesWalletErrormessages.getErrorMessage, so a rejected Freighter signature shows the wallet's message on each action. Tests cover all three.refresh()already clears the stored token on a 401. This PR adds tests for the 401 path (token removed) and the other-failure path (token kept).apiFetchalready has a default timeout and caller cancellation. The timeout test now uses the 1 ms case from the issue's acceptance criterion.Each change is a separate commit.
Testing
npx eslint .passesnpx tsc --noEmitpassesnpm run buildsucceedsThe checks above were not run for this PR. The new and updated tests are in
src/lib/api-error-message.test.ts,src/lib/auth-context.test.tsx,src/lib/api-timeout.test.tsandsrc/app/my-tickets/page.test.tsx. Please runnpm testin CI or locally.🤖 Generated with Claude Code