Commit e4f8a47
authored
feat: apply
## Explanation
This PR adds `lock (mutex)` mechanism to the
seedless-onboarding-controller `setLocked` method to achieve the atomic
state updates and prevent unexpected issues (state out of sync) while
locking the controller and another operation (such as `changePassword`,
`addNewSecretData` etc) is in progress on the other hand.
As a result, we can't simply lock the seedless-onboarding-controller,
syncing with keyring's. Syncing with keyring's lock will cause more
issues in the controller communications as seedless-onboarding
`setLocked`, now, has some side effects and it won't get locked
immediately in some scenarios (when another seedless operation in
progress).
Hence, `setLocked` becomes independent of the Keyring's and this PR also
removes the `KeyringController:lock` and `KeyringController:unlock`
events from the seedless-onboarding messenger.
**BREAKING:**
- Removed `Keyring:lock` and `Keyring:unlock` events from the controller
allowed events.
-
## 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
-->
## Checklist
- [x] I've updated the test suite for new or updated code as appropriate
- [x] I've updated documentation (JSDoc, Markdown, etc.) for new or
updated code as appropriate
- [x] 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
- [x] I've prepared draft pull requests for clients and consumer
packages to resolve any breaking changesmutex on controller lock (#6292)1 parent 761cd35 commit e4f8a47
File tree
5 files changed
+32
-158
lines changed- packages/seedless-onboarding-controller
- src
- tests/__fixtures__
5 files changed
+32
-158
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
| 19 | + | |
18 | 20 | | |
19 | 21 | | |
20 | 22 | | |
21 | 23 | | |
| 24 | + | |
22 | 25 | | |
23 | 26 | | |
24 | 27 | | |
| |||
Lines changed: 12 additions & 128 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
| |||
2665 | 2666 | | |
2666 | 2667 | | |
2667 | 2668 | | |
2668 | | - | |
2669 | | - | |
2670 | | - | |
2671 | | - | |
2672 | | - | |
2673 | | - | |
2674 | | - | |
2675 | | - | |
2676 | | - | |
2677 | | - | |
2678 | | - | |
2679 | | - | |
2680 | | - | |
2681 | | - | |
2682 | | - | |
2683 | | - | |
2684 | | - | |
2685 | | - | |
2686 | | - | |
2687 | | - | |
2688 | | - | |
2689 | | - | |
2690 | | - | |
2691 | 2669 | | |
2692 | 2670 | | |
2693 | 2671 | | |
| |||
2777 | 2755 | | |
2778 | 2756 | | |
2779 | 2757 | | |
2780 | | - | |
2781 | | - | |
2782 | | - | |
2783 | | - | |
2784 | | - | |
2785 | | - | |
2786 | | - | |
2787 | | - | |
2788 | | - | |
2789 | | - | |
2790 | | - | |
2791 | | - | |
2792 | | - | |
2793 | | - | |
2794 | | - | |
2795 | | - | |
2796 | | - | |
2797 | | - | |
2798 | | - | |
2799 | | - | |
2800 | | - | |
2801 | | - | |
2802 | | - | |
2803 | | - | |
2804 | | - | |
2805 | | - | |
2806 | | - | |
2807 | | - | |
2808 | | - | |
2809 | | - | |
2810 | | - | |
2811 | | - | |
2812 | | - | |
2813 | | - | |
2814 | 2758 | | |
2815 | 2759 | | |
2816 | 2760 | | |
| |||
2991 | 2935 | | |
2992 | 2936 | | |
2993 | 2937 | | |
2994 | | - | |
2995 | | - | |
2996 | | - | |
2997 | | - | |
2998 | | - | |
2999 | | - | |
3000 | | - | |
3001 | | - | |
3002 | | - | |
3003 | | - | |
3004 | | - | |
3005 | | - | |
3006 | | - | |
3007 | | - | |
3008 | | - | |
3009 | | - | |
| 2938 | + | |
| 2939 | + | |
| 2940 | + | |
3010 | 2941 | | |
3011 | | - | |
3012 | | - | |
3013 | | - | |
3014 | | - | |
3015 | | - | |
3016 | | - | |
3017 | | - | |
3018 | | - | |
3019 | | - | |
3020 | | - | |
3021 | | - | |
3022 | | - | |
3023 | 2942 | | |
3024 | 2943 | | |
3025 | 2944 | | |
3026 | 2945 | | |
3027 | 2946 | | |
3028 | 2947 | | |
3029 | | - | |
| 2948 | + | |
3030 | 2949 | | |
3031 | 2950 | | |
3032 | 2951 | | |
| |||
3035 | 2954 | | |
3036 | 2955 | | |
3037 | 2956 | | |
3038 | | - | |
| 2957 | + | |
3039 | 2958 | | |
3040 | | - | |
3041 | | - | |
3042 | | - | |
3043 | | - | |
3044 | | - | |
3045 | | - | |
3046 | | - | |
3047 | | - | |
3048 | | - | |
3049 | | - | |
| 2959 | + | |
| 2960 | + | |
3050 | 2961 | | |
3051 | | - | |
3052 | | - | |
3053 | | - | |
3054 | | - | |
3055 | | - | |
3056 | | - | |
3057 | | - | |
3058 | | - | |
3059 | 2962 | | |
3060 | 2963 | | |
3061 | 2964 | | |
3062 | 2965 | | |
3063 | 2966 | | |
3064 | 2967 | | |
3065 | 2968 | | |
3066 | | - | |
3067 | | - | |
3068 | | - | |
3069 | | - | |
3070 | | - | |
3071 | | - | |
3072 | | - | |
3073 | | - | |
3074 | | - | |
3075 | | - | |
3076 | | - | |
3077 | | - | |
3078 | | - | |
3079 | | - | |
3080 | | - | |
3081 | | - | |
3082 | | - | |
3083 | | - | |
3084 | | - | |
3085 | 2969 | | |
3086 | 2970 | | |
3087 | 2971 | | |
| |||
3306 | 3190 | | |
3307 | 3191 | | |
3308 | 3192 | | |
3309 | | - | |
| 3193 | + | |
3310 | 3194 | | |
3311 | 3195 | | |
3312 | 3196 | | |
| |||
3474 | 3358 | | |
3475 | 3359 | | |
3476 | 3360 | | |
3477 | | - | |
| 3361 | + | |
3478 | 3362 | | |
3479 | 3363 | | |
3480 | 3364 | | |
| |||
3791 | 3675 | | |
3792 | 3676 | | |
3793 | 3677 | | |
3794 | | - | |
| 3678 | + | |
3795 | 3679 | | |
3796 | 3680 | | |
3797 | 3681 | | |
| |||
4023 | 3907 | | |
4024 | 3908 | | |
4025 | 3909 | | |
4026 | | - | |
| 3910 | + | |
4027 | 3911 | | |
4028 | 3912 | | |
4029 | 3913 | | |
| |||
Lines changed: 14 additions & 23 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
260 | 260 | | |
261 | 261 | | |
262 | 262 | | |
263 | | - | |
264 | | - | |
265 | | - | |
266 | | - | |
267 | | - | |
268 | | - | |
269 | | - | |
270 | | - | |
271 | | - | |
272 | 263 | | |
273 | 264 | | |
274 | 265 | | |
| |||
697 | 688 | | |
698 | 689 | | |
699 | 690 | | |
| 691 | + | |
| 692 | + | |
700 | 693 | | |
701 | | - | |
702 | | - | |
703 | | - | |
704 | | - | |
705 | | - | |
706 | | - | |
707 | | - | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
708 | 702 | | |
709 | | - | |
710 | | - | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
711 | 706 | | |
712 | 707 | | |
713 | 708 | | |
| |||
1693 | 1688 | | |
1694 | 1689 | | |
1695 | 1690 | | |
| 1691 | + | |
1696 | 1692 | | |
1697 | 1693 | | |
1698 | 1694 | | |
1699 | 1695 | | |
1700 | 1696 | | |
1701 | 1697 | | |
1702 | | - | |
1703 | | - | |
1704 | | - | |
1705 | | - | |
1706 | | - | |
1707 | 1698 | | |
1708 | 1699 | | |
1709 | 1700 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
| 4 | + | |
9 | 5 | | |
10 | 6 | | |
11 | 7 | | |
| |||
206 | 202 | | |
207 | 203 | | |
208 | 204 | | |
209 | | - | |
| 205 | + | |
210 | 206 | | |
211 | 207 | | |
212 | 208 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| |||
0 commit comments