Skip to content

Conversation

@smgv
Copy link
Contributor

@smgv smgv commented Nov 7, 2025

Description

In this PR, it immediately validates the pasted SRP by invoking it on paste.

Jira Link: https://consensyssoftware.atlassian.net/browse/SL-279

Open in GitHub Codespaces

Changelog

CHANGELOG entry: validate seedphrase when user paste the data.

Related issues

Fixes:

Manual testing steps

  1. Go to this page...

Screenshots/Recordings

Before

After

Screen.Recording.2025-11-07.at.4.14.21.PM.mov

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.

Note

Immediately validates pasted SRP words by refactoring the invalid-word checker to accept an SRP list and invoking it on paste.

  • SRP Import (ui/components/app/srp-input-import/srp-input-import.tsx):
    • Refactor checkForInvalidWords to accept an optional srp array, defaulting to current draftSrp.
    • Invoke checkForInvalidWords(newDraftSrp) during paste handling to flag invalid words immediately after parsing input.

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

@smgv smgv self-assigned this Nov 7, 2025
@smgv smgv added area-onboarding needs-qa Label will automate into QA workspace team-web3auth Web3Auth team labels Nov 7, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Nov 7, 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.

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.

Bug: Paste breaks old misspellings on keyboard paste

When pasting via keyboard shortcut (Ctrl+V/Cmd+V), handleOnPaste doesn't clear misSpelledWords before calling onSrpPaste. Since onSrpPaste creates new word objects with new IDs, old misspelled words from previous input remain in state and display incorrect error messages. The paste button flow correctly clears misSpelledWords in onTriggerPaste, but the direct paste handler is missing this cleanup.

ui/components/app/srp-input-import/srp-input-import.tsx#L215-L225

const handleOnPaste = (
clipBoardEvent: React.ClipboardEvent<HTMLTextAreaElement>,
) => {
clipBoardEvent.preventDefault();
const newSrp = clipBoardEvent.clipboardData.getData('text');
if (newSrp.trim().match(/\s/u)) {
clipBoardEvent.preventDefault();
onSrpPaste(newSrp);
}
};

Fix in Cursor Fix in Web


@github-actions github-actions bot added the size-S label Nov 7, 2025
@metamaskbot
Copy link
Collaborator

Builds ready [1b6ee4e]
UI Startup Metrics (1198 ± 87 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyStandard HomeuiStartup1198106115948712261384
load103792014167910751189
domContentLoaded103091514037810681183
domInteractive2113103151852
firstPaint66378141141710421164
backgroundConnect22921431511234242
firstReactRender27179292643
getState20773102337
initialActions001001
loadScripts808696118177845953
setupStore1062731117
numNetworkReqs1367720674
BrowserifyPower User HomeuiStartup19081747282627019442826
load1028886153419812431534
domContentLoaded1020879152419612371524
domInteractive31151072555107
firstPaint71317715634159281563
backgroundConnect23722225110248251
firstReactRender29254762947
getState17615623523189235
initialActions001011
loadScripts798660128619010081286
setupStore1493261532
numNetworkReqs1177624857150248
WebpackStandard HomeuiStartup8397071274888531026
load59154790465585764
domContentLoaded58354089063577751
domInteractive18136691742
firstPaint19863794170182567
backgroundConnect301378153167
firstReactRender321883113556
getState1162331216
initialActions001001
loadScripts58053887961574742
setupStore1363761431
numNetworkReqs1468020871
WebpackPower User HomeuiStartup12571139175416713651754
load66057110481417681048
domContentLoaded64355910301357491030
domInteractive271292254192
firstPaint3757910343297581034
backgroundConnect43151413363141
firstReactRender26242912729
getState1397116724151167
initialActions001011
loadScripts63955610201327381020
setupStore86142914
numNetworkReqs1067121347166213
FirefoxBrowserifyStandard HomeuiStartup15101293197812815941737
load12831120159510013561456
domContentLoaded12831120159410013551455
domInteractive1173531849130224
firstPaint------
backgroundConnect49261642852121
firstReactRender27227562739
getState84506715
initialActions001001
loadScripts1254110315659713191424
setupStore14776101433
numNetworkReqs1266616762
BrowserifyPower User HomeuiStartup25142120316630628163166
load14421156211626416312116
domContentLoaded14411156211626416312116
domInteractive23890675212522675
firstPaint------
backgroundConnect1133433297219332
firstReactRender463089145189
getState1218416722128167
initialActions102112
loadScripts14091136203925616012039
setupStore3361644046164
numNetworkReqs1337122361202223
WebpackStandard HomeuiStartup16721477228015816982051
load14141259181311614611680
domContentLoaded14141259181311614601680
domInteractive1053438848116205
firstPaint------
backgroundConnect50271532356104
firstReactRender31247593143
getState84626817
initialActions001001
loadScripts13831241173310914321602
setupStore167107131537
numNetworkReqs1367417766
WebpackPower User HomeuiStartup25502213336335826683363
load14841257180917817051809
domContentLoaded14841257180917817051809
domInteractive16438436126326436
firstPaint------
backgroundConnect932830877130308
firstReactRender54361002053100
getState1457730560187305
initialActions101011
loadScripts14551236176317316691763
setupStore3262265422226
numNetworkReqs1295629383220293
📊 Page Load Benchmark Results

Current Commit: 1b6ee4e | Date: 11/7/2025

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.04s (±39ms) 🟡 | historical mean value: 1.03s ⬆️ (historical data)
  • domContentLoaded-> current mean value: 722ms (±35ms) 🟢 | historical mean value: 716ms ⬆️ (historical data)
  • firstContentfulPaint-> current mean value: 77ms (±10ms) 🟢 | historical mean value: 76ms ⬆️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.04s 39ms 1.01s 1.31s 1.07s 1.31s
domContentLoaded 722ms 35ms 703ms 987ms 743ms 987ms
firstPaint 77ms 10ms 60ms 160ms 84ms 160ms
firstContentfulPaint 77ms 10ms 60ms 160ms 84ms 160ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 577 Bytes (0.01%)
  • ui: 3.61 KiB (0.05%)
  • common: 19 KiB (0.22%)

@LeVinhGithub LeVinhGithub added QA Passed and removed needs-qa Label will automate into QA workspace labels Nov 10, 2025
Copy link
Contributor

@LeVinhGithub LeVinhGithub left a comment

Choose a reason for hiding this comment

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

lgtm QA

@smgv smgv added this pull request to the merge queue Nov 10, 2025
Merged via the queue into main with commit ddf0513 Nov 10, 2025
351 of 356 checks passed
@smgv smgv deleted the fix/error-validation-srp-import branch November 10, 2025 07:16
@github-actions github-actions bot locked and limited conversation to collaborators Nov 10, 2025
@metamaskbot metamaskbot added the release-13.10.0 Issue or pull request that will be included in release 13.10.0 label Nov 10, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-onboarding QA Passed release-13.10.0 Issue or pull request that will be included in release 13.10.0 size-S team-web3auth Web3Auth team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants