Commit 271d096
authored
chore: Remove MM_PER_DAPP_SELECTED_NETWORK feature flag (#21963)
## **Description**
This is a collective effort to clean up our codebase by removing old
feature flags such as `MM_PER_DAPP_SELECTED_NETWORK`
## **Changelog**
CHANGELOG entry:null
## **Related issues**
Fixes: https://consensyssoftware.atlassian.net/browse/MUL-1132
## **Manual testing steps**
```gherkin
Feature: my feature name
Scenario: user [verb for user action]
Given [describe expected initial app state]
When user [verb for user action]
Then [describe expected outcome]
```
## **Screenshots/Recordings**
`~`
### **Before**
`~`
### **After**
`~`
## **Pre-merge author checklist**
- [x] I’ve followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.
## **Pre-merge reviewer checklist**
- [x] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [x] 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.
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Removes MM_PER_DAPP_SELECTED_NETWORK flag and simplifies code to
always use per-dapp network selection across UI, RPC, WalletConnect,
selectors, hooks, tests, and CI.
>
> - **Network selection (core/infra)**:
> - Remove `MM_PER_DAPP_SELECTED_NETWORK` flag and all conditionals;
per-dapp network selection is now always on.
> - `selectedNetworkController` selectors default to domain-based
values; `selectPerOriginChainId` used broadly.
> - `ethereum-chain-utils.switchToNetwork` and RPC middleware always set
`SelectedNetworkController.setNetworkClientIdForDomain`.
> - `useSwitchNetworks`/NetworkSelector: when dapp connected, always set
per-domain network; otherwise switch global.
> - **UI**:
> - Account/Tx components (`AccountFromToInfoCard`, `AddressFrom`,
`TransactionDetails`, `TransactionNotification`) use tx/chain-specific
data directly (no flag checks).
> - Permissions UIs (`PermissionsSummary`, `AccountPermissions`,
multichain variants) always show per-dapp network picker and set domain
network on changes.
> - BrowserTab: remove legacy permission checks tied to global
selection.
> - **WalletConnect**:
> - Use per-origin chain ID (`selectPerOriginChainId`) and domain
network switching; simplify switch handling and tests accordingly.
> - **Hooks/Utils**:
> - `useAddressBalance` and smart tx publish hook rely on provided
`chainId`/`networkClientId` without gating.
> - **Tests/CI/Config**:
> - Update unit/e2e tests and mocks removing flag; rename E2E titles to
“Dapp Network Switching”.
> - Remove flag from `.js.env.example` and Bitrise envs.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
8de63d1. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent fbc08a6 commit 271d096
File tree
26 files changed
+69
-332
lines changed- app
- components
- UI
- AccountFromToInfoCard
- Notification/TransactionNotification
- PermissionsSummary
- TransactionElement/TransactionDetails
- Views
- AccountPermissions
- BrowserTab
- MultichainAccounts
- MultichainAccountPermissions
- MultichainPermissionsSummary
- NetworkSelector
- confirmations/legacy/components/TransactionReview
- hooks/useAddressBalance
- core
- RPCMethods
- lib
- WalletConnect
- selectors
- util
- networks
- smart-transactions
- e2e/specs/confirmations-redesigned/transactions
26 files changed
+69
-332
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | 95 | | |
99 | 96 | | |
100 | 97 | | |
| |||
Lines changed: 1 addition & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
25 | 24 | | |
26 | 25 | | |
27 | 26 | | |
| |||
170 | 169 | | |
171 | 170 | | |
172 | 171 | | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
| 172 | + | |
178 | 173 | | |
179 | 174 | | |
180 | 175 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | 11 | | |
16 | 12 | | |
17 | 13 | | |
| |||
21 | 17 | | |
22 | 18 | | |
23 | 19 | | |
24 | | - | |
25 | 20 | | |
26 | 21 | | |
27 | 22 | | |
| |||
57 | 52 | | |
58 | 53 | | |
59 | 54 | | |
60 | | - | |
| 55 | + | |
61 | 56 | | |
62 | 57 | | |
63 | 58 | | |
64 | 59 | | |
65 | 60 | | |
66 | 61 | | |
67 | 62 | | |
68 | | - | |
69 | | - | |
70 | 63 | | |
71 | 64 | | |
72 | 65 | | |
| |||
82 | 75 | | |
83 | 76 | | |
84 | 77 | | |
85 | | - | |
86 | | - | |
87 | | - | |
| 78 | + | |
88 | 79 | | |
89 | | - | |
90 | | - | |
91 | | - | |
| 80 | + | |
92 | 81 | | |
93 | 82 | | |
94 | 83 | | |
| |||
Lines changed: 1 addition & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
29 | 28 | | |
30 | 29 | | |
31 | 30 | | |
| |||
37 | 36 | | |
38 | 37 | | |
39 | 38 | | |
40 | | - | |
41 | 39 | | |
42 | 40 | | |
43 | 41 | | |
| |||
454 | 452 | | |
455 | 453 | | |
456 | 454 | | |
457 | | - | |
458 | | - | |
459 | | - | |
| 455 | + | |
460 | 456 | | |
461 | 457 | | |
462 | 458 | | |
| |||
Lines changed: 2 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
| 44 | + | |
48 | 45 | | |
49 | 46 | | |
50 | 47 | | |
| |||
169 | 166 | | |
170 | 167 | | |
171 | 168 | | |
172 | | - | |
173 | | - | |
174 | | - | |
| 169 | + | |
175 | 170 | | |
176 | 171 | | |
177 | 172 | | |
| |||
Lines changed: 4 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
17 | 16 | | |
18 | 17 | | |
19 | 18 | | |
| |||
33 | 32 | | |
34 | 33 | | |
35 | 34 | | |
36 | | - | |
37 | 35 | | |
38 | 36 | | |
39 | 37 | | |
| |||
240 | 238 | | |
241 | 239 | | |
242 | 240 | | |
243 | | - | |
244 | | - | |
245 | | - | |
| 241 | + | |
246 | 242 | | |
247 | 243 | | |
248 | 244 | | |
| |||
382 | 378 | | |
383 | 379 | | |
384 | 380 | | |
385 | | - | |
386 | | - | |
387 | | - | |
| 381 | + | |
388 | 382 | | |
389 | 383 | | |
390 | 384 | | |
| |||
552 | 546 | | |
553 | 547 | | |
554 | 548 | | |
555 | | - | |
556 | | - | |
557 | | - | |
| 549 | + | |
558 | 550 | | |
559 | 551 | | |
560 | 552 | | |
561 | | - | |
562 | | - | |
563 | | - | |
| 553 | + | |
564 | 554 | | |
565 | 555 | | |
566 | 556 | | |
| |||
Lines changed: 7 additions & 21 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
| 64 | + | |
68 | 65 | | |
69 | 66 | | |
70 | 67 | | |
| |||
359 | 356 | | |
360 | 357 | | |
361 | 358 | | |
362 | | - | |
363 | | - | |
364 | | - | |
365 | | - | |
| 359 | + | |
366 | 360 | | |
367 | 361 | | |
368 | 362 | | |
| |||
398 | 392 | | |
399 | 393 | | |
400 | 394 | | |
401 | | - | |
402 | | - | |
403 | | - | |
404 | | - | |
405 | | - | |
406 | | - | |
407 | | - | |
408 | | - | |
409 | | - | |
410 | | - | |
411 | | - | |
412 | | - | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
413 | 400 | | |
414 | 401 | | |
415 | 402 | | |
| |||
418 | 405 | | |
419 | 406 | | |
420 | 407 | | |
421 | | - | |
422 | 408 | | |
423 | 409 | | |
424 | 410 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
52 | 51 | | |
53 | 52 | | |
54 | 53 | | |
| |||
78 | 77 | | |
79 | 78 | | |
80 | 79 | | |
81 | | - | |
82 | | - | |
| 80 | + | |
83 | 81 | | |
84 | 82 | | |
85 | 83 | | |
| |||
113 | 111 | | |
114 | 112 | | |
115 | 113 | | |
116 | | - | |
117 | 114 | | |
118 | 115 | | |
119 | 116 | | |
120 | 117 | | |
121 | 118 | | |
122 | | - | |
123 | | - | |
124 | 119 | | |
125 | 120 | | |
126 | 121 | | |
| |||
145 | 140 | | |
146 | 141 | | |
147 | 142 | | |
148 | | - | |
149 | 143 | | |
150 | 144 | | |
151 | 145 | | |
| |||
258 | 252 | | |
259 | 253 | | |
260 | 254 | | |
261 | | - | |
262 | | - | |
263 | 255 | | |
264 | 256 | | |
265 | 257 | | |
| |||
685 | 677 | | |
686 | 678 | | |
687 | 679 | | |
688 | | - | |
689 | | - | |
690 | | - | |
691 | | - | |
692 | | - | |
693 | | - | |
694 | | - | |
695 | | - | |
696 | | - | |
697 | | - | |
698 | | - | |
699 | | - | |
700 | | - | |
701 | | - | |
702 | | - | |
703 | | - | |
704 | | - | |
705 | | - | |
706 | | - | |
707 | | - | |
708 | | - | |
709 | | - | |
710 | | - | |
711 | | - | |
712 | | - | |
713 | | - | |
714 | | - | |
715 | | - | |
716 | | - | |
717 | | - | |
718 | | - | |
719 | | - | |
720 | | - | |
721 | | - | |
722 | | - | |
723 | | - | |
724 | | - | |
725 | | - | |
726 | | - | |
727 | | - | |
728 | | - | |
729 | | - | |
730 | | - | |
731 | | - | |
732 | | - | |
733 | | - | |
734 | | - | |
735 | | - | |
736 | | - | |
737 | | - | |
738 | | - | |
739 | | - | |
740 | | - | |
741 | | - | |
742 | 680 | | |
743 | 681 | | |
744 | 682 | | |
| |||
781 | 719 | | |
782 | 720 | | |
783 | 721 | | |
784 | | - | |
785 | | - | |
786 | | - | |
787 | | - | |
788 | 722 | | |
789 | 723 | | |
790 | 724 | | |
| |||
794 | 728 | | |
795 | 729 | | |
796 | 730 | | |
797 | | - | |
798 | 731 | | |
799 | 732 | | |
800 | 733 | | |
| |||
1206 | 1139 | | |
1207 | 1140 | | |
1208 | 1141 | | |
1209 | | - | |
1210 | | - | |
1211 | | - | |
1212 | | - | |
1213 | | - | |
1214 | | - | |
1215 | 1142 | | |
1216 | 1143 | | |
1217 | 1144 | | |
| |||
Lines changed: 0 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
227 | 227 | | |
228 | 228 | | |
229 | 229 | | |
230 | | - | |
231 | 230 | | |
232 | 231 | | |
233 | 232 | | |
| |||
0 commit comments