Commit 4b5929b
refactor: migrate polling controllers to
## Explanation
<!--
Thanks for your contribution! Take a moment to answer these questions so
that reviewers have the information they need to properly understand
your changes:
* What is the current state of things and why does it need to change?
* What is the solution your changes offer and how does it work?
* Are there any changes whose purpose might not obvious to those
unfamiliar with the domain?
* If your primary goal was to update one package but you found you had
to update another one along the way, why did you do so?
* If you had to upgrade a dependency, why did you do so?
-->
This PR migrates all controllers extending
`StaticIntervalPollingController` to use `@metamask/messenger` instead
of `@metamask/base-controller`. This is part of a larger effort to
migrate all controllers to use `@metamask/messenger`.
## References
<!--
Are there any issues that this pull request is tied to?
Are there other links that reviewers should consult to understand these
changes better?
Are there client or consumer pull requests to adopt any breaking
changes?
For example:
* Fixes #12345
* Related to #67890
-->
* Related to #5626
## Checklist
- [ ] I've updated the test suite for new or updated code as appropriate
- [ ] I've updated documentation (JSDoc, Markdown, etc.) for new or
updated code as appropriate
- [ ] I've communicated my changes to consumers by [updating changelogs
for packages I've
changed](https://github.com/MetaMask/core/tree/main/docs/contributing.md#updating-changelogs),
highlighting breaking changes as necessary
- [ ] I've prepared draft pull requests for clients and consumer
packages to resolve any breaking changes
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Migrates polling infrastructure and multiple controllers to use
@metamask/messenger, updates state metadata APIs/tests, and adjusts
dependencies and exports across affected packages.
>
> - **Messenger migration**:
> - Replace `RestrictedMessenger` with `@metamask/messenger` across
controllers: `AccountTrackerController`, `CurrencyRateController`,
`DeFiPositionsController`, `MultichainAssetsRatesController`,
`TokenBalancesController`, `TokenDetectionController`,
`TokenListController`, `TokenRatesController`, `BridgeController`,
`BridgeStatusController`, and `SubscriptionController`.
> - Update tests to construct/delegate new `Messenger` instances; switch
`deriveStateFromMetadata` imports to `@metamask/base-controller/next`.
> - **Polling infrastructure**:
> - Refactor `StaticIntervalPollingController` and
`BlockTrackerPollingController` to use `@metamask/messenger`; remove
`StaticIntervalPollingControllerNext`.
> - Update `GasFeeController` to extend
`StaticIntervalPollingController`.
> - **State metadata/API**:
> - Rename metadata flag `anonymous` to `includeInDebugSnapshot` and
adjust usage in controllers/tests.
> - **Bridge package**:
> - Add and export `BridgeControllerGetStateAction` and
`BridgeControllerStateChangeEvent` types; integrate messenger for
actions/subscriptions; fetch/track calls updated.
> - **Subscription package**:
> - Migrate controller to new messenger; wire authentication
actions/events; update polling and handlers.
> - **Changelogs/deps**:
> - Update changelogs to note BREAKING changes; add
`@metamask/messenger` dependencies; update TS references; minor README
dependency graph tweaks.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
b9a05a4. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
---------
Co-authored-by: Mark Stacey <markjstacey@gmail.com>@metamask/messenger (#6444)1 parent 7d6e178 commit 4b5929b
File tree
48 files changed
+823
-590
lines changed- packages
- assets-controllers
- src
- DeFiPositionsController
- MultichainAssetsRatesController
- bridge-controller
- src
- bridge-status-controller
- src
- utils
- gas-fee-controller
- src
- polling-controller
- src
- subscription-controller
- src
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
48 files changed
+823
-590
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
187 | 187 | | |
188 | 188 | | |
189 | 189 | | |
| 190 | + | |
190 | 191 | | |
191 | 192 | | |
192 | 193 | | |
| |||
352 | 353 | | |
353 | 354 | | |
354 | 355 | | |
| 356 | + | |
355 | 357 | | |
356 | 358 | | |
357 | 359 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | | - | |
| 59 | + | |
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
10 | 14 | | |
11 | 15 | | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
12 | 25 | | |
13 | 26 | | |
14 | 27 | | |
| |||
40 | 53 | | |
41 | 54 | | |
42 | 55 | | |
43 | | - | |
44 | 56 | | |
45 | 57 | | |
46 | 58 | | |
| |||
Lines changed: 39 additions & 23 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
4 | 11 | | |
5 | 12 | | |
6 | 13 | | |
| |||
14 | 21 | | |
15 | 22 | | |
16 | 23 | | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
| 24 | + | |
22 | 25 | | |
23 | 26 | | |
24 | 27 | | |
25 | 28 | | |
26 | 29 | | |
27 | 30 | | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | 31 | | |
33 | 32 | | |
34 | 33 | | |
35 | 34 | | |
36 | 35 | | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
37 | 48 | | |
38 | 49 | | |
39 | 50 | | |
| |||
1368 | 1379 | | |
1369 | 1380 | | |
1370 | 1381 | | |
1371 | | - | |
| 1382 | + | |
1372 | 1383 | | |
1373 | 1384 | | |
1374 | 1385 | | |
| |||
1428 | 1439 | | |
1429 | 1440 | | |
1430 | 1441 | | |
1431 | | - | |
1432 | | - | |
1433 | | - | |
1434 | | - | |
| 1442 | + | |
1435 | 1443 | | |
1436 | 1444 | | |
1437 | 1445 | | |
| |||
1475 | 1483 | | |
1476 | 1484 | | |
1477 | 1485 | | |
1478 | | - | |
1479 | | - | |
1480 | | - | |
1481 | | - | |
| 1486 | + | |
| 1487 | + | |
| 1488 | + | |
1482 | 1489 | | |
1483 | 1490 | | |
1484 | 1491 | | |
| |||
1584 | 1591 | | |
1585 | 1592 | | |
1586 | 1593 | | |
1587 | | - | |
1588 | | - | |
1589 | | - | |
| 1594 | + | |
| 1595 | + | |
| 1596 | + | |
| 1597 | + | |
| 1598 | + | |
| 1599 | + | |
| 1600 | + | |
| 1601 | + | |
| 1602 | + | |
| 1603 | + | |
| 1604 | + | |
| 1605 | + | |
1590 | 1606 | | |
1591 | 1607 | | |
1592 | 1608 | | |
1593 | 1609 | | |
1594 | 1610 | | |
1595 | 1611 | | |
1596 | | - | |
| 1612 | + | |
1597 | 1613 | | |
1598 | 1614 | | |
1599 | 1615 | | |
| |||
Lines changed: 26 additions & 30 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | | - | |
| 11 | + | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| |||
127 | 128 | | |
128 | 129 | | |
129 | 130 | | |
130 | | - | |
| 131 | + | |
131 | 132 | | |
132 | 133 | | |
133 | 134 | | |
134 | | - | |
| 135 | + | |
135 | 136 | | |
136 | 137 | | |
137 | 138 | | |
| |||
205 | 206 | | |
206 | 207 | | |
207 | 208 | | |
208 | | - | |
| 209 | + | |
209 | 210 | | |
210 | 211 | | |
211 | | - | |
212 | | - | |
213 | | - | |
| 212 | + | |
214 | 213 | | |
215 | 214 | | |
216 | 215 | | |
| |||
243 | 242 | | |
244 | 243 | | |
245 | 244 | | |
246 | | - | |
| 245 | + | |
247 | 246 | | |
248 | 247 | | |
249 | 248 | | |
| |||
305 | 304 | | |
306 | 305 | | |
307 | 306 | | |
308 | | - | |
| 307 | + | |
309 | 308 | | |
310 | 309 | | |
311 | 310 | | |
| |||
317 | 316 | | |
318 | 317 | | |
319 | 318 | | |
320 | | - | |
| 319 | + | |
321 | 320 | | |
322 | 321 | | |
323 | 322 | | |
| |||
327 | 326 | | |
328 | 327 | | |
329 | 328 | | |
330 | | - | |
| 329 | + | |
331 | 330 | | |
332 | 331 | | |
333 | 332 | | |
| |||
342 | 341 | | |
343 | 342 | | |
344 | 343 | | |
345 | | - | |
| 344 | + | |
346 | 345 | | |
347 | 346 | | |
348 | 347 | | |
349 | 348 | | |
350 | | - | |
| 349 | + | |
351 | 350 | | |
352 | 351 | | |
353 | 352 | | |
| |||
367 | 366 | | |
368 | 367 | | |
369 | 368 | | |
370 | | - | |
| 369 | + | |
371 | 370 | | |
372 | 371 | | |
373 | 372 | | |
| |||
401 | 400 | | |
402 | 401 | | |
403 | 402 | | |
404 | | - | |
| 403 | + | |
405 | 404 | | |
406 | 405 | | |
407 | 406 | | |
408 | 407 | | |
409 | | - | |
| 408 | + | |
410 | 409 | | |
411 | 410 | | |
412 | 411 | | |
413 | 412 | | |
414 | 413 | | |
415 | 414 | | |
416 | 415 | | |
417 | | - | |
| 416 | + | |
418 | 417 | | |
419 | 418 | | |
420 | 419 | | |
421 | 420 | | |
422 | | - | |
| 421 | + | |
423 | 422 | | |
424 | 423 | | |
425 | 424 | | |
| |||
460 | 459 | | |
461 | 460 | | |
462 | 461 | | |
463 | | - | |
464 | | - | |
| 462 | + | |
465 | 463 | | |
466 | 464 | | |
467 | 465 | | |
468 | 466 | | |
469 | | - | |
| 467 | + | |
470 | 468 | | |
471 | 469 | | |
472 | 470 | | |
| |||
485 | 483 | | |
486 | 484 | | |
487 | 485 | | |
488 | | - | |
| 486 | + | |
489 | 487 | | |
490 | 488 | | |
491 | 489 | | |
| |||
524 | 522 | | |
525 | 523 | | |
526 | 524 | | |
527 | | - | |
| 525 | + | |
528 | 526 | | |
529 | 527 | | |
530 | | - | |
531 | | - | |
532 | | - | |
533 | | - | |
| 528 | + | |
| 529 | + | |
534 | 530 | | |
535 | 531 | | |
536 | 532 | | |
| |||
863 | 859 | | |
864 | 860 | | |
865 | 861 | | |
866 | | - | |
| 862 | + | |
867 | 863 | | |
868 | 864 | | |
869 | 865 | | |
870 | 866 | | |
871 | | - | |
| 867 | + | |
872 | 868 | | |
873 | 869 | | |
874 | 870 | | |
| |||
0 commit comments