Commit dd973e4
authored
feat: Add
Adds a lazily populated `isReady` state property that is populated as a
side-effect of `ensureCanUsePlatform` (renamed from
`assertCanUsePlatform`).
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Introduces `isReady` to `SnapController` state, lazily populated via
new `#ensureCanUsePlatform`, and updates flows/tests accordingly.
>
> - **State/Metadata**:
> - Add `state.isReady` (default `false`); include in
`includeInStateLogs` and `includeInDebugSnapshot`; not persisted/used in
UI.
> - **Platform readiness**:
> - Replace `#assertCanUsePlatform` with `#ensureCanUsePlatform` that
waits onboarding, sets `isReady` based on `disableSnaps`, and asserts
availability.
> - Call `#ensureCanUsePlatform` in `init()`, `updateRegistry()`,
`startSnap()`, `installSnaps()`, `#updateSnap()`, and `handleRequest()`.
> - Reset `isReady` to `false` in `clearState()`.
> - **Tests**:
> - Add test verifying `SnapController:init` sets `isReady`.
> - Update expectations to include `isReady` in debug/state logs and
post-`clearState` state, and minor timing adjustments.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
2df985d. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->isReady state property (#3778)1 parent 24b87d3 commit dd973e4
File tree
2 files changed
+55
-8
lines changed- packages/snaps-controllers/src/snaps
2 files changed
+55
-8
lines changedLines changed: 26 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10624 | 10624 | | |
10625 | 10625 | | |
10626 | 10626 | | |
| 10627 | + | |
| 10628 | + | |
10627 | 10629 | | |
10628 | 10630 | | |
10629 | 10631 | | |
| |||
10647 | 10649 | | |
10648 | 10650 | | |
10649 | 10651 | | |
| 10652 | + | |
10650 | 10653 | | |
10651 | 10654 | | |
10652 | 10655 | | |
| |||
10769 | 10772 | | |
10770 | 10773 | | |
10771 | 10774 | | |
| 10775 | + | |
| 10776 | + | |
| 10777 | + | |
| 10778 | + | |
| 10779 | + | |
| 10780 | + | |
| 10781 | + | |
| 10782 | + | |
| 10783 | + | |
| 10784 | + | |
| 10785 | + | |
| 10786 | + | |
| 10787 | + | |
| 10788 | + | |
| 10789 | + | |
| 10790 | + | |
| 10791 | + | |
10772 | 10792 | | |
10773 | 10793 | | |
10774 | 10794 | | |
| |||
12997 | 13017 | | |
12998 | 13018 | | |
12999 | 13019 | | |
13000 | | - | |
| 13020 | + | |
| 13021 | + | |
| 13022 | + | |
| 13023 | + | |
| 13024 | + | |
13001 | 13025 | | |
13002 | 13026 | | |
13003 | 13027 | | |
| |||
13012 | 13036 | | |
13013 | 13037 | | |
13014 | 13038 | | |
| 13039 | + | |
13015 | 13040 | | |
13016 | 13041 | | |
13017 | 13042 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
318 | 318 | | |
319 | 319 | | |
320 | 320 | | |
| 321 | + | |
321 | 322 | | |
322 | 323 | | |
323 | 324 | | |
| |||
854 | 855 | | |
855 | 856 | | |
856 | 857 | | |
| 858 | + | |
857 | 859 | | |
858 | 860 | | |
859 | 861 | | |
| |||
965 | 967 | | |
966 | 968 | | |
967 | 969 | | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
968 | 976 | | |
969 | 977 | | |
970 | 978 | | |
| |||
1327 | 1335 | | |
1328 | 1336 | | |
1329 | 1337 | | |
| 1338 | + | |
| 1339 | + | |
| 1340 | + | |
1330 | 1341 | | |
1331 | 1342 | | |
1332 | 1343 | | |
| |||
1537 | 1548 | | |
1538 | 1549 | | |
1539 | 1550 | | |
1540 | | - | |
| 1551 | + | |
1541 | 1552 | | |
1542 | 1553 | | |
1543 | 1554 | | |
| |||
1717 | 1728 | | |
1718 | 1729 | | |
1719 | 1730 | | |
1720 | | - | |
| 1731 | + | |
1721 | 1732 | | |
1722 | 1733 | | |
1723 | 1734 | | |
1724 | 1735 | | |
| 1736 | + | |
| 1737 | + | |
| 1738 | + | |
| 1739 | + | |
| 1740 | + | |
| 1741 | + | |
| 1742 | + | |
| 1743 | + | |
| 1744 | + | |
| 1745 | + | |
1725 | 1746 | | |
1726 | | - | |
| 1747 | + | |
1727 | 1748 | | |
1728 | 1749 | | |
1729 | 1750 | | |
| |||
1803 | 1824 | | |
1804 | 1825 | | |
1805 | 1826 | | |
1806 | | - | |
| 1827 | + | |
1807 | 1828 | | |
1808 | 1829 | | |
1809 | 1830 | | |
| |||
2387 | 2408 | | |
2388 | 2409 | | |
2389 | 2410 | | |
| 2411 | + | |
2390 | 2412 | | |
2391 | 2413 | | |
2392 | 2414 | | |
| |||
2703 | 2725 | | |
2704 | 2726 | | |
2705 | 2727 | | |
2706 | | - | |
| 2728 | + | |
2707 | 2729 | | |
2708 | 2730 | | |
2709 | 2731 | | |
| |||
2989 | 3011 | | |
2990 | 3012 | | |
2991 | 3013 | | |
2992 | | - | |
| 3014 | + | |
2993 | 3015 | | |
2994 | 3016 | | |
2995 | 3017 | | |
| |||
3624 | 3646 | | |
3625 | 3647 | | |
3626 | 3648 | | |
3627 | | - | |
| 3649 | + | |
3628 | 3650 | | |
3629 | 3651 | | |
3630 | 3652 | | |
| |||
0 commit comments