Repository navigation
Conversation
… to render Bottom sheets render through the portal host near the app root, so a render error inside a dApp sheet went straight to the fatal error handler. An error boundary inside the request sheet and one inside the connection sheet now reject the request or proposal with its own reason, close the sheet and show a toast. The rejected request counts as answered, so the teardown neither rejects it again nor records a user rejection. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t be shown Connected Apps builds its rows on Home and draws them in a bottom sheet, so a render error in either took Home or the sheet down, along with the way to disconnect the dApp behind it. An error boundary inside the sheet now shows a message and keeps the sheet's "Disconnect all" footer, and one around the component swaps in a stand-in sheet with the message and its own "Disconnect all" button. Disconnecting changes the sessions, which clears the error. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A render error in a sheet's content is caught while the sheet is still mounting, and the bottom sheet ignores dismiss() until its opening animation starts, so the request or connection sheet went on to open, empty, over its backdrop. The boundary now marks the sheet as failed, and the sheet is dismissed as soon as it reports that it has opened. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The request sheet's boundary left the request in the event store until the deferred teardown, so a sessions refresh in between handed it to the dispatch effect again (a second rejection and toast), and a request arriving in between was replaced and never shown. Clear the event at once, as handleSessionRequest's catch already does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
Android Emulator preview APK is ready: https://github.com/stellar/freighter-mobile/releases/tag/untagged-b136dec5fad99c0402ba |
Contributor
|
iOS Simulator preview build is ready: https://github.com/stellar/freighter-mobile/releases/tag/untagged-e985966f326965af9588 |
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.
TL;DR
Stacked on #1062. A render error inside a dApp sheet now fails closed instead of crashing the app:
Bottom sheets render through a portal host near the app root, so a boundary has to sit inside each sheet's content to see its errors. This reuses the existing error boundary.
Lines changed
Only this PR's own changes, not those of the PRs it's stacked on.
Screenshots and recordings (iPhone SE simulator on iOS 27.2, Pixel 10 Pro emulator)
For these, a local change that is not part of this PR makes the request sheet throw for one message, and Connected Apps throw for the test dApp's row. The request comes from a local WalletConnect test client.
In dev builds React Native's LogBox also opens its full-screen "Render Error" panel for an error a boundary catches; it was turned off for these captures. Release builds have no LogBox.
Implementation details (for agents)
What changed:
src/providers/WalletKitProvider.tsx:ErrorBoundary(resetKey= the request id). ItsonError,handleRequestSheetRenderError, rejects the request withwalletKit.sheetRenderFailedReason, marks it answered so the teardown neither rejects it again nor records a user rejection, shows the toast, clears the event at once (as the request handler's catch does) and runs the teardown. It does nothing while an approval is in flight or after a response, since that teardown is already on its way.resetKey= the proposal id). It does nothing while the connection is being approved.dismiss()until the opening animation starts, so the sheet would go on to open, empty (found on the simulator). Each boundary therefore marks its sheet as failed, and the sheet'sonChangedismisses it as soon as it reports an open index (closeSheetIfFailed).freighter-mobile/src/providers/WalletKitProvider.tsx
Lines 791 to 884 in c9cd2db
freighter-mobile/src/providers/WalletKitProvider.tsx
Lines 1704 to 1738 in c9cd2db
freighter-mobile/src/providers/WalletKitProvider.tsx
Lines 1751 to 1794 in c9cd2db
src/components/screens/HomeScreen/ConnectedApps.tsx:ConnectedAppsUnavailable. HomeScreen is unchanged.freighter-mobile/src/components/screens/HomeScreen/ConnectedApps.tsx
Lines 168 to 211 in c9cd2db
src/components/screens/HomeScreen/ConnectedAppsUnavailable.tsx(new): a stand-in Connected Apps sheet with the message and a "Disconnect all" button.i18n (en, pt):
walletKit.sheetRenderFailedTitle,walletKit.sheetRenderFailed,walletKit.sheetRenderFailedReason,connectedApps.loadFailed. The button reuses the existing "Disconnect all".Verification:
yarn test: 355 suites pass, 5,316 tests pass and 6 are skipped. New tests: a request sheet and a connection sheet that fail to render (one rejection with the reason, the toast, no user rejection recorded, the next request renders); a sheet that failed while opening is dismissed once it opens, and the next one isn't; a sessions refresh or a new request during the teardown (the failed request isn't handled again, the new one shows); Connected Apps' two fallbacks and their "Disconnect all".yarn lint:tspasses, and ESLint and Prettier pass on every changed file.onChangedismissal fixes.🤖 Generated with Claude Code