Skip to content

Conversation

@FrederikBolding
Copy link
Member

@FrederikBolding FrederikBolding commented Feb 3, 2026

Description

Fixes an issue introduced in aa3b155 that caused Snaps to crash when using buttons without names. We changed the fallback for value to null which gets passed as a parameter to onUserInput. This is invalid and crashes the Snap.

Open in GitHub Codespaces

Changelog

CHANGELOG entry: Prevent Snap crashing when clicking buttons without names

Related issues

https://consensyssoftware.atlassian.net/browse/WPC-362

Manual testing steps

  1. Install the following Snap: https://snaps.metamask.io/snap/npm/quai-snap/
  2. Go to its home page
  3. Click send
  4. Fill out the form with some bogus values (your own address and some value)
  5. Click send
  6. Check that the Snap does not crash in the console

Note

Low Risk
Low risk, targeted change to Snap onUserInput event payloads; main risk is subtle behavior change if any Snap relied on a value field for ButtonClickEvent.

Overview
Prevents Snaps from crashing when a submit Button has no name by ensuring ButtonClickEvent requests never include a value field (including null) in the onUserInput payload.

Adds a regression test covering form submission with an unnamed submit button, asserting the emitted button-click event omits name and value while form submission still includes the form value map.

Written by Cursor Bugbot for commit 95c6fad. This will update automatically on new commits. Configure here.

@metamaskbotv2
Copy link
Contributor

metamaskbotv2 bot commented Feb 3, 2026

✨ Files requiring CODEOWNER review ✨

🫰 @MetaMask/core-platform (2 files, +79 -1)
  • 📁 ui/
    • 📁 components/
      • 📁 app/
        • 📁 snaps/
          • 📁 snap-ui-renderer/
            • 📁 components/
              • 📄 form.test.ts +74 -0
    • 📁 contexts/
      • 📁 snaps/
        • 📄 snap-interface.tsx +5 -1

@metamaskbot metamaskbot added the INVALID-PR-TEMPLATE PR's body doesn't match template label Feb 3, 2026
@FrederikBolding FrederikBolding changed the title fix: Prevent Snap crashing when clicking buttons without names fix: Prevent Snap crashing when clicking buttons without names cp-13.17.0 Feb 3, 2026
Mrtenz
Mrtenz previously approved these changes Feb 3, 2026
GuillaumeRx
GuillaumeRx previously approved these changes Feb 3, 2026
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

@metamaskbotv2
Copy link
Contributor

metamaskbotv2 bot commented Feb 3, 2026

Builds ready [95c6fad]
UI Startup Metrics (1422 ± 95 ms)
PlatformBuildTypePageMetricTest Title (ms)Persona (ms)Mean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--1422119417169514951561
load--1215100114619212871329
domContentLoaded--120999714529212791323
domInteractive--271698182476
firstPaint--167671341133207274
backgroundConnect--24022028213247269
firstReactRender--18104662034
initialActions--109113
loadScripts--98477712259110541103
setupStore--1363361727
numNetworkReqs--221579171571
19--------
BrowserifyPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--19431609265316220012263
load--1121994194315711041569
domContentLoaded--1104985192715110901548
domInteractive--3318154233195
firstPaint--208691954238235338
backgroundConnect--31828448732333376
firstReactRender--24154362739
initialActions--105113
loadScripts--86875316441398501267
setupStore--1575361727
numNetworkReqs--1254925854152241
19--------
WebpackStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--88168113901289641106
load--74461111171148331014
domContentLoaded--73760711111138211009
domInteractive--281793192486
firstPaint--1256385693162241
backgroundConnect--38181512546115
firstReactRender--17113461931
initialActions--104112
loadScripts--73460511091138181007
setupStore--1375671323
numNetworkReqs--221585181579
19--------
WebpackPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--1254855223823014091670
load--70861810851107011030
domContentLoaded--69861010801106941024
domInteractive--35172183331109
firstPaint--1366452487161291
backgroundConnect--15913035447159315
firstReactRender--23184042530
initialActions--102111
loadScripts--69660810731086921017
setupStore--1254351318
numNetworkReqs--1304626562160257
19--------
FirefoxBrowserifyStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--16691348219115617681929
load--14101175179513114991670
domContentLoaded--14091175179513114991670
domInteractive--773717736101146
firstPaint--------
backgroundConnect--842932352122189
firstReactRender--12102321314
initialActions--102122
loadScripts--13611159169011114081576
setupStore--196217381366
numNetworkReqs--241191201983
19--------
BrowserifyPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--29592182492060129804503
load--15971221298735616762492
domContentLoaded--15961221298735516762486
domInteractive--12336743114125370
firstPaint--------
backgroundConnect--30511613792862801012
firstReactRender--17146451821
initialActions--212022
loadScripts--15431199256931615952371
setupStore--1277794188137627
numNetworkReqs--71352004294180
19--------
WebpackStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--16811393220118218302027
load--14441199182513315241711
domContentLoaded--14441199182413315241710
domInteractive--1022931149133199
firstPaint--------
backgroundConnect--69232174888185
firstReactRender--14114941518
initialActions--103122
loadScripts--14071171180812114691654
setupStore--176184271267
numNetworkReqs--231282171875
19--------
WebpackPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--314722119531114232834401
load--17971304715094718282820
domContentLoaded--17961303715094818272820
domInteractive--178335708568119490
firstPaint--------
backgroundConnect--3191111362271298960
firstReactRender--22156882431
initialActions--217123
loadScripts--17461285711894617342793
setupStore--1448736193184663
numNetworkReqs--70352294385180
19--------
📊 Page Load Benchmark Results

Current Commit: 95c6fad | Date: 2/3/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.04s (±39ms) 🟡 | historical mean value: 1.02s ⬆️ (historical data)
  • domContentLoaded-> current mean value: 725ms (±36ms) 🟢 | historical mean value: 712ms ⬆️ (historical data)
  • firstContentfulPaint-> current mean value: 77ms (±12ms) 🟢 | historical mean value: 79ms ⬇️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.04s 39ms 1.01s 1.33s 1.06s 1.33s
domContentLoaded 725ms 36ms 701ms 997ms 745ms 997ms
firstPaint 77ms 12ms 64ms 192ms 84ms 192ms
firstContentfulPaint 77ms 12ms 64ms 192ms 84ms 192ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs
  • background: 58 Bytes (0%)
  • ui: 43 Bytes (0%)
  • common: 20 Bytes (0%)

@FrederikBolding FrederikBolding added this pull request to the merge queue Feb 3, 2026
Merged via the queue into main with commit 094fa7f Feb 3, 2026
179 checks passed
@FrederikBolding FrederikBolding deleted the fb/snaps-ui-crash branch February 3, 2026 11:38
@github-actions github-actions bot locked and limited conversation to collaborators Feb 3, 2026
@metamaskbot metamaskbot added the release-13.18.0 Issue or pull request that will be included in release 13.18.0 label Feb 3, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

INVALID-PR-TEMPLATE PR's body doesn't match template release-13.18.0 Issue or pull request that will be included in release 13.18.0 size-S team-core-platform Core Platform team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants