Skip to content

Conversation

@GuillaumeRx
Copy link
Contributor

@GuillaumeRx GuillaumeRx commented Aug 5, 2025

Description

Handle errors thrown by handleSnapRequest in SnapInterfaceContext to avoid unhandled errors caught by Sentry.

Open in GitHub Codespaces

Changelog

CHANGELOG entry:null

Related issues

Fixes: #22286

Manual testing steps

  1. Have a test snap that triggers an error when clicking a button in a home-page
  2. Click the button
  3. Look at the UI console to ensure the good error is thrown

Screenshots/Recordings

Before

After

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

@GuillaumeRx GuillaumeRx requested a review from a team as a code owner August 5, 2025 09:15
@github-actions
Copy link
Contributor

github-actions bot commented Aug 5, 2025

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@metamaskbot metamaskbot added the team-snaps-platform-deprecated DEPRECATED: please use "team-core-platform" instead (or "team-new-networks" for Solana snap issues) label Aug 5, 2025
@metamaskbot
Copy link
Collaborator

✨ Files requiring CODEOWNER review ✨

👨‍🔧 @MetaMask/core-platform (1 files, +8 -1)
  • 📁 ui/
    • 📁 contexts/
      • 📁 snaps/
        • 📄 snap-interface.tsx +8 -1

Co-authored-by: Maarten Zuidhoorn <[email protected]>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should port this change to mobile too

@GuillaumeRx GuillaumeRx enabled auto-merge August 5, 2025 09:22
@metamaskbot
Copy link
Collaborator

Builds ready [05f0470]
UI Startup Metrics (1137 ± 73 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyHomeuiStartup1137102414767311651274
load9668551271709951100
domContentLoaded9588461264719891089
domInteractive17137271625
firstPaint5637210973869721039
backgroundConnect2152012499217231
firstReactRender20154452136
getState1046081426
initialActions30527214
loadScripts751631104470780881
setupStore64222710
WebpackHomeuiStartup22481658267623424032632
load16741204201620017921948
domContentLoaded16661200200219917871937
domInteractive191299181483
firstPaint1666645369194291
backgroundConnect2912234233347
firstReactRender21294421109352395
getState204277451246
initialActions8229729611
loadScripts16621198199919717841926
setupStore3172916616263
FirefoxBrowserifyHomeuiStartup13131150177311713721556
load113498314639111871316
domContentLoaded113498314629111861316
domInteractive983428847103221
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect2515112142743
firstReactRender25195992454
getState62416514
initialActions40579219
loadScripts111396814468611661293
setupStore9318319524
WebpackHomeuiStartup15911364226915116651908
load13251152171011213871539
domContentLoaded13251152171011213871538
domInteractive943126044100230
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect3318164233392
firstReactRender51437665560
getState92569826
initialActions5112713417
loadScripts12981133159710613661503
setupStore15423032949
Benchmark value 215 exceeds gate value 10 for chrome browserify home mean backgroundConnect
Benchmark value 4 exceeds gate value 1 for chrome browserify home mean initialActions
Benchmark value 232 exceeds gate value 18 for chrome browserify home p95 backgroundConnect
Benchmark value 14 exceeds gate value 1.2 for chrome browserify home p95 initialActions
Benchmark value 2248 exceeds gate value 2192 for chrome webpack home mean uiStartup
Benchmark value 9 exceeds gate value 7 for chrome webpack home mean initialActions
Benchmark value 2632 exceeds gate value 2454 for chrome webpack home p95 uiStartup
Benchmark value 83 exceeds gate value 57 for chrome webpack home p95 domInteractive
Benchmark value 395 exceeds gate value 370 for chrome webpack home p95 firstReactRender
Benchmark value 11 exceeds gate value 7 for chrome webpack home p95 initialActions
Benchmark value 263 exceeds gate value 65 for chrome webpack home p95 setupStore
Benchmark value 26 exceeds gate value 25 for firefox browserify home mean backgroundConnect
Benchmark value 26 exceeds gate value 25 for firefox browserify home mean firstReactRender
Benchmark value 4 exceeds gate value 1 for firefox browserify home mean initialActions
Benchmark value 221 exceeds gate value 195 for firefox browserify home p95 domInteractive
Benchmark value 19 exceeds gate value 2 for firefox browserify home p95 initialActions
Benchmark value 34 exceeds gate value 26 for firefox webpack home mean backgroundConnect
Benchmark value 52 exceeds gate value 38 for firefox webpack home mean firstReactRender
Benchmark value 6 exceeds gate value 1 for firefox webpack home mean initialActions
Benchmark value 16 exceeds gate value 13 for firefox webpack home mean setupStore
Benchmark value 230 exceeds gate value 156 for firefox webpack home p95 domInteractive
Benchmark value 92 exceeds gate value 49 for firefox webpack home p95 backgroundConnect
Benchmark value 60 exceeds gate value 50 for firefox webpack home p95 firstReactRender
Benchmark value 17 exceeds gate value 2 for firefox webpack home p95 initialActions
Benchmark value 49 exceeds gate value 28 for firefox webpack home p95 setupStore
Sum of mean exceeds: 301ms | Sum of p95 exceeds: 863.8ms
Sum of all benchmark exceeds: 1164.8ms

Bundle size diffs [🚀 Bundle size reduced!]
  • background: -309.44 KiB (-5.65%)
  • ui: -472.73 KiB (-6.36%)
  • common: -1.1 MiB (-13.16%)

@GuillaumeRx GuillaumeRx added this pull request to the merge queue Aug 5, 2025
Merged via the queue into main with commit bb90c36 Aug 5, 2025
272 of 275 checks passed
@GuillaumeRx GuillaumeRx deleted the gr/fix-unhandled-error-homepage branch August 5, 2025 10:51
@github-actions github-actions bot locked and limited conversation to collaborators Aug 5, 2025
@gauthierpetetin gauthierpetetin added release-13.2.0 Issue or pull request that will be included in release 13.2.0 and removed release-13.3.0 labels Aug 12, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-13.2.0 Issue or pull request that will be included in release 13.2.0 team-snaps-platform-deprecated DEPRECATED: please use "team-core-platform" instead (or "team-new-networks" for Solana snap issues)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Sentry] Error: The method does not exist / is not available.

6 participants