Repository navigation
fix(pos-app): iOS payment details crash + "Incorrect API key" errors - #655
Merged
Merged
Conversation
Creating a payment with rejected credentials showed "This terminal has lost access", and listing payments showed "Check your internet connection". Both now say the API key is incorrect when the error is invalid_api_key or a 401: - Payment failure: "Incorrect API key" (still routes to Settings for direct credentials); a bare 401 now maps to invalid_api_key too. - Activity: "Incorrect API key" with Go to Settings (Try again in the dashboard iframe, whose credentials Settings can't fix); the refresh toast mentions the API key. - Web transactions service keeps the HTTP status and API error code instead of throwing a plain Error, so the screen can tell a 401 apart. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CmgutsXzUS2j26BNUevhrE
The transaction detail sheet formats the token amount with pay-core's formatTokenAmount, which reads the decimal separator via Intl.NumberFormat#formatToParts. Hermes doesn't implement that on Apple platforms (llvm_unreachable), so opening a payment's details crashed the iOS app (RCTFatal). Format token amounts locally with the same output, reading the separator from toLocaleString instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CmgutsXzUS2j26BNUevhrE
|
The latest updates on your projects. Learn more about Vercel for GitHub.
2 Skipped Deployments
|
|
Claude finished @juanisierra's task in 3m 14s —— View job Code Review
Found 2 issue(s)Issue 1:
|
jakubuid
approved these changes
Oct 23, 2026
This branch was successfully deployed
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
iOS crash when opening a payment's details
formatTokenAmountfrom@walletconnect/pay-core, which reads the decimal separator viaIntl.NumberFormat#formatToParts. Hermes doesn't implement that on Apple platforms (llvm_unreachable("formatToParts is unimplemented on Apple platforms")in the shipped Hermes version), so opening details crashed the iOS app (RCTFatal).utils/currency.tsnow has its ownformatTokenAmountwith the same output as pay-core (2–6 decimals,≈when digits are cut,<0.000001for dust) that reads the separator fromtoLocaleString(). The detail sheet and the receipt printer use it. pay-core 0.7.0 (latest) still has the issue."Incorrect API key" when the API rejects credentials
invalid_api_keycode) is mapped to it too. Button unchanged (Go to Settings for local credentials, Start new payment in the dashboard iframe).services/transactions.web.tsnow keeps the HTTP status and API error code (viareadProxyResponse) instead of throwing a plainError, so the screen can tell a 401 from a network failure.isInvalidApiKeyError()inutils/payment-errors.ts(invalid_api_keycode or status 401).Tests
__tests__/utils/currency.test.ts: expected outputs, parity with pay-core, and a check thatformatToPartsis never called (fails against the pay-core re-export).isInvalidApiKeyError, web transactions keeping 401 + code, and Activity screen cases (message, Go to Settings, bare 401, refresh toast). These fail without the change.npm test: 39 suites / 384 tests passing; lint clean.🤖 Generated with Claude Code
https://claude.ai/code/session_01CmgutsXzUS2j26BNUevhrE