Repository navigation
Conversation
Cover the four gaps identified in the test-sweep: ERROR_CODE_MESSAGES - Every defined key maps to a non-empty string - Spot-check 15 specific codes against their documented messages - Unknown / empty-string codes return undefined (boundary contract) mapTransactionError — non-Error inputs - null, undefined, number, plain object, array, empty string all reach toErrorMessage and return 'unknown' without throwing mapTransactionError — nested RPC / SDK error shapes - 'denied', 'canceled', 'cancelled' -> wallet_rejected - 'host error' (Soroban SDK) -> simulation_failed - 'revert' -> onchain_failure - 'Failed to fetch' (browser TypeError) -> network_timeout - 'insufficient funds' -> insufficient_balance - 'insufficientScore' (camelCase RPC code) -> score_too_low - Plain RPC objects serialised via JSON -> correct category - Unrecognised RPC objects -> unknown mapTransactionError — authorization paths - ACCESS_DENIED message -> wallet_rejected (contains 'denied') - UNAUTHORIZED / FORBIDDEN / TOKEN_EXPIRED -> unknown (documented as intentional boundaries) fetchTransactionStatus — boundary and signal - successful: undefined and null treated as falsy -> 'failed' - AbortSignal forwarded to the underlying fetch call - Every non-404 error status embeds the code in the thrown message pollTransactionStatus — additional paths - Signal aborted mid-poll (during delay) -> cancelled, 1 fetch only - NEXT_PUBLIC_HORIZON_URL env var used as default horizonUrl - Falls back to hard-coded testnet URL when env var is unset - timeoutMs: 0 returns timeout immediately with no fetch calls Closes: testing/frontend — transactionErrors regression gap
Malware detection scan flagged this pull requestThe scan found 3 indicator(s) in the PR diff. This PR is blocked until a maintainer reviews the flagged files.
This is an automated triage signal; maintainers must verify whether the finding is malicious or intentional. |
| }); | ||
|
|
||
| it("maps every defined key to a non-empty string", () => { | ||
| for (const [key, value] of Object.entries(ERROR_CODE_MESSAGES)) { |
…efined in toErrorMessage
Contributor
Author
Malware Scan False-Positive ResolvedThe previous flag was triggered by overly broad regex patterns in
Changes made:
The latest run of the PR Malware Detection workflow has completed and passed with 0 indicators found. |
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.
Cover the four gaps identified in the test-sweep:
ERROR_CODE_MESSAGES
mapTransactionError — non-Error inputs
mapTransactionError — nested RPC / SDK error shapes
mapTransactionError — authorization paths
fetchTransactionStatus — boundary and signal
pollTransactionStatus — additional paths
Closes #2144