feat: add state-machine for appLockflow [WPB-23186]#21005
feat: add state-machine for appLockflow [WPB-23186]#21005
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev #21005 +/- ##
==========================================
+ Coverage 44.58% 44.61% +0.02%
==========================================
Files 1696 1697 +1
Lines 43893 43923 +30
Branches 9036 9043 +7
==========================================
+ Hits 19571 19597 +26
- Misses 22269 22270 +1
- Partials 2053 2056 +3
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
🔗 Download Full Report Artifact 🧪 Playwright Test Summary
|
|
I think this pull request would be easier to review and safer to roll back if the CI / dependency-management changes were separated from the product behavior changes. Right now the branch combines app-lock work with workflow and automation updates, which makes review scope larger than necessary. |
|
|
@screendriver, waiting for your review. |
| target: appLockStateName.unlocked, | ||
| actions: assign({isChangingPasscode: false}), | ||
| }, | ||
| [appLockEventType.disable]: { |
There was a problem hiding this comment.
This changes the current product behavior for optional app-lock setup.
DISABLE in setup is currently guarded by !context.isEnforced && context.isChangingPasscode, which means first-time setup cannot be cancelled after the user enables app lock. In the existing user interface that cancel path is allowed when app lock is optional and not yet activated.
| target: appLockStateName.unprotected, | ||
| guard: ({context}) => !context.isEnforced, | ||
| }, | ||
| [appLockEventType.lockEnforced]: { |
There was a problem hiding this comment.
LOCK_ENFORCED only updates context in unprotected and unlocked. If enforcement changes while the machine is in setup, locked, forgotPasscode or wipeConfirm, context.isEnforced stays stale and later guard decisions can be wrong.



Summary
Added state machine for appLock flow

https://stately.ai/registry/editor/5b37cbe9-127b-4b50-b3bb-3ffec900e2b6?mode=Simulate&machineId=9d4336ce-95a7-47a3-94a5-2ee7288d31a3
Security Checklist (required)
Accessibility (required)
Standards Acknowledgement (required)
Screenshots or demo (if the user interface changed)
Notes for reviewers