Skip to content

feat: poll incoming transactions only when viewing transaction list #33783

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

matthewwalsh0
Copy link
Member

@matthewwalsh0 matthewwalsh0 commented Jun 19, 2025

Description

Poll incoming transactions from the accounts API only when viewing the transaction list.

Continue to stop polling when closing all popups as a safety measure.

Open in GitHub Codespaces

Related issues

Fixes: #5190

Manual testing steps

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.

@metamaskbot metamaskbot added the team-confirmations Push issues to confirmations team label Jun 19, 2025
@metamaskbot
Copy link
Collaborator

✨ Files requiring CODEOWNER review ✨

@MetaMask/confirmations (1 files, +4 -0)
  • 📁 app/
    • 📁 scripts/
      • 📁 controller-init/
        • 📁 confirmations/
          • 📄 transaction-controller-init.ts +4 -0

@metamaskbot
Copy link
Collaborator

Builds ready [7c760eb]
UI Startup Metrics (1231 ± 60 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyHomeuiStartup1231107614246012801320
load106494511765611061159
domContentLoaded105894011655610991154
domInteractive18136171737
firstPaint75398116341510921140
backgroundConnect74314711
firstReactRender23174662439
getState1463172026
initialActions001001
loadScripts81270091654853903
setupStore85213815
WebpackHomeuiStartup21571654264321622852567
load16541236205218317721943
domContentLoaded16491232204818217681932
domInteractive171174121453
firstPaint1726948079208355
backgroundConnect19104262332
firstReactRender21890409115360399
getState144308301226
initialActions215134
loadScripts16461230203818117671921
setupStore207296391626
FirefoxBrowserifyHomeuiStartup13341151192811413721550
load1171101815588012131325
domContentLoaded1171101815588012131324
domInteractive1123651277107203
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect2113139142040
firstReactRender24205452428
getState1056610839
initialActions001001
loadScripts1154100415427911951304
setupStore948313635
WebpackHomeuiStartup16291428221317817282038
load14051224190215715231674
domContentLoaded14051224190215715231674
domInteractive98323326594306
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect23167772333
firstReactRender43325444650
getState1164971029
initialActions102111
loadScripts13851204187215715031657
setupStore1164371130
Benchmark value 2568 exceeds gate value 2454 for chrome webpack home p95 uiStartup
Benchmark value 355 exceeds gate value 334 for chrome webpack home p95 firstPaint
Benchmark value 399 exceeds gate value 370 for chrome webpack home p95 firstReactRender
Benchmark value 112 exceeds gate value 110 for firefox browserify home mean domInteractive
Benchmark value 10 exceeds gate value 9 for firefox browserify home mean setupStore
Benchmark value 203 exceeds gate value 195 for firefox browserify home p95 domInteractive
Benchmark value 39 exceeds gate value 24 for firefox browserify home p95 getState
Benchmark value 35 exceeds gate value 27 for firefox browserify home p95 setupStore
Benchmark value 1629 exceeds gate value 1615 for firefox webpack home mean uiStartup
Benchmark value 1406 exceeds gate value 1380 for firefox webpack home mean load
Benchmark value 1405 exceeds gate value 1380 for firefox webpack home mean domContentLoaded
Benchmark value 44 exceeds gate value 38 for firefox webpack home mean firstReactRender
Benchmark value 1385 exceeds gate value 1360 for firefox webpack home mean loadScripts
Benchmark value 2038 exceeds gate value 1935 for firefox webpack home p95 uiStartup
Benchmark value 1674 exceeds gate value 1660 for firefox webpack home p95 load
Benchmark value 1674 exceeds gate value 1660 for firefox webpack home p95 domContentLoaded
Benchmark value 306 exceeds gate value 156 for firefox webpack home p95 domInteractive
Benchmark value 1657 exceeds gate value 1630 for firefox webpack home p95 loadScripts
Benchmark value 30 exceeds gate value 28 for firefox webpack home p95 setupStore
Sum of mean exceeds: 99ms | Sum of p95 exceeds: 505ms
Sum of all benchmark exceeds: 604ms

Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 69.34 KiB (1.31%)
  • ui: 19.46 KiB (0.27%)
  • common: 43.84 KiB (0.53%)

@matthewwalsh0 matthewwalsh0 force-pushed the feat/incoming-transaction-polling-activity-only branch from f119b59 to ef5293a Compare June 19, 2025 21:45
Copy link

socket-security bot commented Jun 19, 2025

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updated@​metamask/​transaction-controller@​57.4.0 ⏵ 58.0.0-preview-08a4995100 +4100100 +22100 +1100

View full report

@metamaskbot
Copy link
Collaborator

Builds ready [ef5293a]
UI Startup Metrics (1262 ± 66 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyHomeuiStartup1262115815786613051364
load109096713756511341194
domContentLoaded108396213546411281188
domInteractive18148481731
firstPaint849167136640411091183
backgroundConnect84294720
firstReactRender21173832225
getState1463472026
initialActions001001
loadScripts833712109263875937
setupStore95244818
WebpackHomeuiStartup20871649257921922052517
load15871247199318416921895
domContentLoaded15811243198818316881885
domInteractive161161111350
firstPaint1726337466218313
backgroundConnect19123852129
firstReactRender23187431117378397
getState1043151121
initialActions215134
loadScripts15791242197818216871875
setupStore1473341522
FirefoxBrowserifyHomeuiStartup14241250193411514691667
load1249108415968713091404
domContentLoaded1249108415968713091404
domInteractive1213753571130191
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect2615124162550
firstReactRender25223632530
getState1249815933
initialActions001001
loadScripts1227106215758812841383
setupStore948013722
WebpackHomeuiStartup15361352222918316132013
load13271172194915614161665
domContentLoaded13271172194815614161664
domInteractive92324806784274
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect2214126122331
firstReactRender40314934245
getState1053161029
initialActions002111
loadScripts13071148192715413991646
setupStore105477931
Benchmark value 1262 exceeds gate value 1234 for chrome browserify home mean uiStartup
Benchmark value 1091 exceeds gate value 1070 for chrome browserify home mean load
Benchmark value 1084 exceeds gate value 1061 for chrome browserify home mean domContentLoaded
Benchmark value 850 exceeds gate value 800 for chrome browserify home mean firstPaint
Benchmark value 833 exceeds gate value 830 for chrome browserify home mean loadScripts
Benchmark value 1195 exceeds gate value 1190 for chrome browserify home p95 load
Benchmark value 1189 exceeds gate value 1180 for chrome browserify home p95 domContentLoaded
Benchmark value 1184 exceeds gate value 1180 for chrome browserify home p95 firstPaint
Benchmark value 21 exceeds gate value 18 for chrome browserify home p95 backgroundConnect
Benchmark value 18 exceeds gate value 17 for chrome browserify home p95 setupStore
Benchmark value 2517 exceeds gate value 2454 for chrome webpack home p95 uiStartup
Benchmark value 397 exceeds gate value 370 for chrome webpack home p95 firstReactRender
Benchmark value 1424 exceeds gate value 1405 for firefox browserify home mean uiStartup
Benchmark value 1249 exceeds gate value 1245 for firefox browserify home mean load
Benchmark value 1249 exceeds gate value 1239 for firefox browserify home mean domContentLoaded
Benchmark value 122 exceeds gate value 110 for firefox browserify home mean domInteractive
Benchmark value 26 exceeds gate value 25 for firefox browserify home mean backgroundConnect
Benchmark value 12 exceeds gate value 11 for firefox browserify home mean getState
Benchmark value 10 exceeds gate value 9 for firefox browserify home mean setupStore
Benchmark value 1667 exceeds gate value 1660 for firefox browserify home p95 uiStartup
Benchmark value 33 exceeds gate value 24 for firefox browserify home p95 getState
Benchmark value 40 exceeds gate value 38 for firefox webpack home mean firstReactRender
Benchmark value 2013 exceeds gate value 1935 for firefox webpack home p95 uiStartup
Benchmark value 1665 exceeds gate value 1660 for firefox webpack home p95 load
Benchmark value 1664 exceeds gate value 1660 for firefox webpack home p95 domContentLoaded
Benchmark value 274 exceeds gate value 156 for firefox webpack home p95 domInteractive
Benchmark value 1646 exceeds gate value 1630 for firefox webpack home p95 loadScripts
Benchmark value 31 exceeds gate value 28 for firefox webpack home p95 setupStore
Sum of mean exceeds: 175ms | Sum of p95 exceeds: 352ms
Sum of all benchmark exceeds: 527ms

Bundle size diffs [🚀 Bundle size reduced!]
  • background: -490 Bytes (-0.01%)
  • ui: 549 Bytes (0.01%)
  • common: -1.49 KiB (-0.02%)

@metamaskbot
Copy link
Collaborator

Builds ready [68f9be4]
UI Startup Metrics (1236 ± 74 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyHomeuiStartup1236111314907412701372
load106492113147210971205
domContentLoaded105791313087110901199
domInteractive18144771738
firstPaint748141131541310751150
backgroundConnect74465813
firstReactRender2416147142346
getState1363871926
initialActions001001
loadScripts808670106472836950
setupStore95295921
WebpackHomeuiStartup21261660264121722492537
load16081236197018317161943
domContentLoaded16021232195918217121935
domInteractive171176131352
firstPaint1726260976205313
backgroundConnect2212234222535
firstReactRender24389557129384423
getState1144671224
initialActions316135
loadScripts15991230194918017091925
setupStore237309501727
FirefoxBrowserifyHomeuiStartup13651170176511614001661
load1198104115048412541363
domContentLoaded1198104015038412541363
domInteractive1163542563132266
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect2513151212369
firstReactRender24204132531
getState1057610924
initialActions001001
loadScripts1178102714868112291324
setupStore84669718
WebpackHomeuiStartup15681367216417516581944
load13571164182414514581597
domContentLoaded13561163182314514571597
domInteractive91325235888189
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect21154252234
firstReactRender40314734346
getState1054271030
initialActions002111
loadScripts13381148179714414411579
setupStore10510513840
Benchmark value 1236 exceeds gate value 1234 for chrome browserify home mean uiStartup
Benchmark value 24 exceeds gate value 23 for chrome browserify home mean firstReactRender
Benchmark value 1372 exceeds gate value 1365 for chrome browserify home p95 uiStartup
Benchmark value 1205 exceeds gate value 1190 for chrome browserify home p95 load
Benchmark value 1199 exceeds gate value 1180 for chrome browserify home p95 domContentLoaded
Benchmark value 46 exceeds gate value 45 for chrome browserify home p95 firstReactRender
Benchmark value 950 exceeds gate value 940 for chrome browserify home p95 loadScripts
Benchmark value 21 exceeds gate value 17 for chrome browserify home p95 setupStore
Benchmark value 243 exceeds gate value 235 for chrome webpack home mean firstReactRender
Benchmark value 2538 exceeds gate value 2454 for chrome webpack home p95 uiStartup
Benchmark value 423 exceeds gate value 370 for chrome webpack home p95 firstReactRender
Benchmark value 116 exceeds gate value 110 for firefox browserify home mean domInteractive
Benchmark value 1661 exceeds gate value 1660 for firefox browserify home p95 uiStartup
Benchmark value 266 exceeds gate value 195 for firefox browserify home p95 domInteractive
Benchmark value 41 exceeds gate value 38 for firefox webpack home mean firstReactRender
Benchmark value 1944 exceeds gate value 1935 for firefox webpack home p95 uiStartup
Benchmark value 189 exceeds gate value 156 for firefox webpack home p95 domInteractive
Benchmark value 40 exceeds gate value 28 for firefox webpack home p95 setupStore
Sum of mean exceeds: 20ms | Sum of p95 exceeds: 319ms
Sum of all benchmark exceeds: 339ms

Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: -415 Bytes (-0.01%)
  • ui: 1.29 KiB (0.02%)
  • common: 35.99 KiB (0.43%)

@metamaskbot
Copy link
Collaborator

Builds ready [90a93ed]
UI Startup Metrics (1252 ± 65 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyHomeuiStartup1252112014766512931365
load107997213136311121191
domContentLoaded107296713066311061182
domInteractive18144561730
firstPaint75573119442410961148
backgroundConnect74284719
firstReactRender22173852235
getState1563372027
initialActions001001
loadScripts822717105161860937
setupStore85223818
WebpackHomeuiStartup21531643267520822532579
load16491229206717917311989
domContentLoaded16401226206217417281972
domInteractive171262121354
firstPaint1696447170191325
backgroundConnect2211291282333
firstReactRender23091413117380401
getState1043451119
initialActions316134
loadScripts16381224205217217261962
setupStore197315411624
FirefoxBrowserifyHomeuiStartup13721174179111714191685
load1205104215969412601380
domContentLoaded1205104115959412601380
domInteractive1123541156117252
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect2213100132245
firstReactRender24215342530
getState1058613832
initialActions001001
loadScripts1186102915108912421354
setupStore1047212734
WebpackHomeuiStartup15451338215818116192030
load13331150184715714181779
domContentLoaded13331150184715714181779
domInteractive89313516081273
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect22157182335
firstReactRender40314734346
getState135106131032
initialActions002111
loadScripts13141132182715514031747
setupStore95365819
Benchmark value 1252 exceeds gate value 1234 for chrome browserify home mean uiStartup
Benchmark value 1080 exceeds gate value 1070 for chrome browserify home mean load
Benchmark value 1073 exceeds gate value 1061 for chrome browserify home mean domContentLoaded
Benchmark value 1191 exceeds gate value 1190 for chrome browserify home p95 load
Benchmark value 1183 exceeds gate value 1180 for chrome browserify home p95 domContentLoaded
Benchmark value 19 exceeds gate value 18 for chrome browserify home p95 backgroundConnect
Benchmark value 18 exceeds gate value 17 for chrome browserify home p95 setupStore
Benchmark value 2579 exceeds gate value 2454 for chrome webpack home p95 uiStartup
Benchmark value 401 exceeds gate value 370 for chrome webpack home p95 firstReactRender
Benchmark value 112 exceeds gate value 110 for firefox browserify home mean domInteractive
Benchmark value 10 exceeds gate value 9 for firefox browserify home mean setupStore
Benchmark value 1685 exceeds gate value 1660 for firefox browserify home p95 uiStartup
Benchmark value 252 exceeds gate value 195 for firefox browserify home p95 domInteractive
Benchmark value 32 exceeds gate value 24 for firefox browserify home p95 getState
Benchmark value 34 exceeds gate value 27 for firefox browserify home p95 setupStore
Benchmark value 41 exceeds gate value 38 for firefox webpack home mean firstReactRender
Benchmark value 2030 exceeds gate value 1935 for firefox webpack home p95 uiStartup
Benchmark value 1779 exceeds gate value 1660 for firefox webpack home p95 load
Benchmark value 1779 exceeds gate value 1660 for firefox webpack home p95 domContentLoaded
Benchmark value 273 exceeds gate value 156 for firefox webpack home p95 domInteractive
Benchmark value 1747 exceeds gate value 1630 for firefox webpack home p95 loadScripts
Sum of mean exceeds: 46ms | Sum of p95 exceeds: 826ms
Sum of all benchmark exceeds: 872ms

Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: -1.82 KiB (-0.03%)
  • ui: 9.9 KiB (0.14%)
  • common: 36.9 KiB (0.44%)

@metamaskbot
Copy link
Collaborator

Builds ready [da08ee9]
UI Startup Metrics (1220 ± 66 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyHomeuiStartup1220109714216612571368
load105292312406510951179
domContentLoaded104490712356610831174
domInteractive17145961730
firstPaint676138124242410661134
backgroundConnect104377829
firstReactRender21166052227
getState1453771926
initialActions001001
loadScripts79865398165836921
setupStore85274819
WebpackHomeuiStartup23011788294921624052696
load17641329219818118632035
domContentLoaded17571325218118018582030
domInteractive171283131448
firstPaint1786464995197386
backgroundConnect231178102540
firstReactRender24090424107364403
getState1355691628
initialActions317135
loadScripts17541323216917818572028
setupStore197183182335
FirefoxBrowserifyHomeuiStartup13441199175510813811627
load1180106314017212311303
domContentLoaded1180106314017212301303
domInteractive1113447366111178
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect2113107132146
firstReactRender23213422327
getState1059313928
initialActions001001
loadScripts1162105113847212171287
setupStore10411815933
WebpackHomeuiStartup15581370205317616382013
load13501162182115114361676
domContentLoaded13501162182015114351675
domInteractive95303736589287
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect22157182240
firstReactRender40305244347
getState1053351022
initialActions002111
loadScripts13311147180015014171659
setupStore9510511821
Benchmark value 1368 exceeds gate value 1365 for chrome browserify home p95 uiStartup
Benchmark value 29 exceeds gate value 18 for chrome browserify home p95 backgroundConnect
Benchmark value 19 exceeds gate value 17 for chrome browserify home p95 setupStore
Benchmark value 2302 exceeds gate value 2192 for chrome webpack home mean uiStartup
Benchmark value 1764 exceeds gate value 1711 for chrome webpack home mean load
Benchmark value 1758 exceeds gate value 1704 for chrome webpack home mean domContentLoaded
Benchmark value 240 exceeds gate value 235 for chrome webpack home mean firstReactRender
Benchmark value 1755 exceeds gate value 1699 for chrome webpack home mean loadScripts
Benchmark value 2696 exceeds gate value 2454 for chrome webpack home p95 uiStartup
Benchmark value 2035 exceeds gate value 2030 for chrome webpack home p95 load
Benchmark value 2031 exceeds gate value 2005 for chrome webpack home p95 domContentLoaded
Benchmark value 387 exceeds gate value 334 for chrome webpack home p95 firstPaint
Benchmark value 403 exceeds gate value 370 for chrome webpack home p95 firstReactRender
Benchmark value 2029 exceeds gate value 1970 for chrome webpack home p95 loadScripts
Benchmark value 111 exceeds gate value 110 for firefox browserify home mean domInteractive
Benchmark value 10 exceeds gate value 9 for firefox browserify home mean setupStore
Benchmark value 28 exceeds gate value 24 for firefox browserify home p95 getState
Benchmark value 33 exceeds gate value 27 for firefox browserify home p95 setupStore
Benchmark value 41 exceeds gate value 38 for firefox webpack home mean firstReactRender
Benchmark value 2013 exceeds gate value 1935 for firefox webpack home p95 uiStartup
Benchmark value 1676 exceeds gate value 1660 for firefox webpack home p95 load
Benchmark value 1675 exceeds gate value 1660 for firefox webpack home p95 domContentLoaded
Benchmark value 287 exceeds gate value 156 for firefox webpack home p95 domInteractive
Benchmark value 1659 exceeds gate value 1630 for firefox webpack home p95 loadScripts
Sum of mean exceeds: 283ms | Sum of p95 exceeds: 713ms
Sum of all benchmark exceeds: 996ms

Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: -4.22 KiB (-0.08%)
  • ui: 13.29 KiB (0.18%)
  • common: 38.35 KiB (0.46%)

@matthewwalsh0 matthewwalsh0 marked this pull request as ready for review June 20, 2025 15:10
@matthewwalsh0 matthewwalsh0 requested a review from a team as a code owner June 20, 2025 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team-confirmations Push issues to confirmations team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants