Repository navigation
Conversation
The pre-start replays sign-in.ad through agent-device; its snapshot ref goes stale when the tree re-renders before the press, so recent web prestart runs fail with 'Unknown ref' on step 1. The sign_in tool performs the same BeginSignIn/SignUpUser actions BaseLoginForm performs and waits for the session token, with no snapshot in the path. Dev builds only: @appduct/web resolves to its inert entry outside the development export condition. accountExists=true refuses rather than faking success (emailed magic code is a CI physical blocker); the caller mints a fresh alias instead.
|
|
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
- Onyx.connect -> connectWithoutView (rulesdir/no-onyx-connect; registration has no view, same form as setup/addUtilsToWindow.ts). - Test payloads used strings that drift from the real types: AUTH_TOKEN_TYPES.ANONYMOUS is 'anonymousAccount', AUTO_AUTH_STATE has no 'signedIn' member, OnyxCommon.Errors values are message strings. Tests now read the constants themselves so the anonymous-boot regression cannot regress to a string that merely looks right. - cspell: appduct + prestart. Found via PR Expensify#103808 CI: typecheck, ESLint, spellcheck all failed on these.
The native entry needs the RN SDK for tool registration and the /auto deep-link install. 0.16.0 pins @appduct/web to the same version, so the PoC's ^0.14 range is raised to match instead of carrying two SDK majors.
Tool logic moves to platform-neutral modules registered through a registerTool
parameter: index.web.ts passes @appduct/web's, index.ts passes
@appduct/react-native's (guarded on __DEV__, /auto imported lazily so the
deep-link install is not bundled in release). prestart_status becomes
get_state; sign_in and get_state return the shared {ok, already, state, reason}
envelope; complete_onboarding added per the looking-around path in research 03.
complete_onboarding guarantees the stored flag, not the dispatch: it waits for
the sequential queue to drain, fails when CompleteGuidedSetup never left the
queue or the flag reverted, never posts a second request while one is queued,
and runs the UI's post-onboarding navigation so the modal closes.
Jest: @Appduct ships ESM only, so the transform allowlist gains @Appduct.
Handlers read input defensively instead of asserting the shape, so a malformed call returns ok:false with a reason. Test files follow the house ordering (imports, then jest.mock factories), drop await Onyx.init (init is sync), and reuse real isAnonymousUser through a typed requireActual.
…/appduct-state-tools
navigateAfterOnboardingWithMicrotaskQueue gained an isAnonymousUser parameter before onboardingPolicyID. Pass it from the tool, and mock @libs/API without requireActual in the complete-onboarding test, which now hits an import cycle through the real module.
…rminology checks npm test runs Jest with --experimental-vm-modules, where requiring the type:module @Appduct packages fails for every suite that imports the app setup. Add root mocks for @appduct/react-native, its /auto entry and @appduct/web, and drop the transform allowlist entry that could not help. Also stop exporting the tool types nothing imports (knip) and rename a test title that tripped the validateCode terminology check.
|
🚧 rlinoz has triggered a test Expensify/App build. You can view the workflow run here. |
This comment has been minimized.
This comment has been minimized.
One TOOL_RESULT_SCHEMA replaces three copies of the output schema, currentAccountID() and sessionLogin() replace the repeated session/credentials lookups, and complete_onboarding's already-completed path shares the exit with the main path.
…appduct-login-poc
…op the timeoutMs input, share the unit tests
…account ID constant
tgolen
left a comment
There was a problem hiding this comment.
Looks, good. Thanks for moving those!
@appduct/react-native links only into a configuration named Debug, while standalone iOS builds use DebugDevelopment, so the tools never registered.
The unchecked wait fell through to signUpUser while the sign-in attempt could still be pending, then reported a misleading missing-session reason.
aa8e21d
|
This PR adds a new |
|
Thank you for the review @rlinoz ❤️ Addressed ✅ |
Julesssss
left a comment
There was a problem hiding this comment.
Cautiously approving the new approach. Lets make sure to keep an eye on the success rate of tests and follow up with any regressions.
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / Safari |
|
🚧 rlinoz has triggered a test Expensify/App build. You can view the workflow run here. |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
Thanks @rlinoz @Julesssss! I will share a health check after collecting meaningful run sample to make validate we are doing ok. |
|
Heads-up: I am aware pre-start is failing and working on fixing this right now 🔜 |
|
🚀 Deployed to staging by https://github.com/rlinoz in version: 9.5.36-0 🚀
|
|
No help site update needed — this PR adds development-only test automation tools, without changing customer-facing features, workflows, or existing article accuracy. |
|
No FullStory changes needed — this PR adds development-only test automation tools, with no new user-facing elements, screens, user-property values, or sensitive-content displays. |
|
🚀 Deployed to production by https://github.com/yuwenmemon in version: 9.5.36-0 🚀
Bundle Size Analysis (Sentry): |
Explanation of Change
Adds three dev-only in-app tools,
get_state,sign_inandcomplete_onboarding, that a test harness calls over Appduct to reach a signed-in, onboarded Home screen without replaying the sign-in and onboarding screens.Flow: before and after
flowchart TD boot(["Dev build boots with an anonymous session"]):::shared boot --> uiEmail["Fill Phone or email, press Continue"]:::removed uiEmail --> uiJoin["Press Join"]:::removed uiJoin --> uiSkip["Skip the work email step"]:::removed uiSkip --> uiPurpose["Pick Something else"]:::removed uiPurpose --> uiName["Fill first and last name, press Continue"]:::removed uiName --> home boot --> signIn["sign_in(email)"]:::added signIn --> onboard["complete_onboarding(firstName, lastName)"]:::added onboard --> home(["Home, onboarding modal closed"]):::shared boot -.-> getState["get_state(): read-only, callable at any step"]:::added classDef shared fill:#e5e7eb,stroke:#4b5563,color:#111827 classDef removed fill:#fee2e2,stroke:#b91c1c,color:#7f1d1d classDef added fill:#dcfce7,stroke:#15803d,color:#14532dLegend: gray = shared, red = UI steps a caller no longer replays (the UI flows under
.claude/skills/agent-device/flows/macros/are unchanged), green = tool calls added here.Contracts
Every tool returns the same result and never throws:
oktrueonly after the target state is read back inside the app, not when work is dispatchedalreadystatereasonok: falsestateon successalready: truewhenok: falsereasonsget_statebooted,signedIn,anonymous,login,accountID,onboardingCompleted(nulluntil loaded),isLoadingAppok: truesign_inemail(required),timeoutMs(default 45000)signedIn,accountID,loginbeginSignInerrors; no session token in timecomplete_onboardingfirstName,lastName(required),timeoutMs(default 60000)onboardingCompleted: true,onboardingModalClosedtrueand nothing queuedHow the tools act
beginSignIn,signUpUser,completeOnboardingwithCONST.ONBOARDING_CHOICES.LOOKING_AROUND(the "Something else" choice).connectWithoutViewand write nothing directly.complete_onboardingwaits forCompleteGuidedSetupto leave the write queue, re-reads the stored flag, then closes the onboarding modal.CompleteGuidedSetupfrom an earlier call is awaited, never posted twice.Platforms
@appduct/web^0.16.0developmentcondition@appduct/react-native^0.16.0__DEV__is false; the native module is debug-onlyBoth packages ship ESM only, so Jest uses mocks under
__mocks__/@appduct/.Improvement landscape
A typed, dev-only tool layer turns setup into function calls that run the app's own actions, so UI driving is left for the screen under test.
sign_in: composite session creationcomplete_onboarding: composite onboardingget_state: state assertionnull) fromfalsereasonon failurecreate_workspaceovercreateWorkspaceinvite_membersoveraddMembersToWorkspacerequestMoney/trackExpensesign_outoversignOut, thensign_inas a second new accountreset_stateoverclearOnyxAndResetAppnavigateoverNavigation.navigatewait_for_writesoverwaitForWritesand the persisted queuecomplete_onboardingalready does this internallyFixed Issues
$ https://github.com/Expensify/Expensify/issues/699321
Tests
tests/unit/appductSignInToolTest.tsalreadyfor a matching session; refuses another login; reports the magic-code wall; surfacesbeginSignInerrors; times out with the account snapshottests/unit/appductGetStateToolTest.tsfalsetests/unit/appductCompleteOnboardingToolTest.tsalreadywithout calling the action; waits for a queued request instead of posting twice; fails on a reverted flag, a stuck queue, unmet preconditions, and a missing Concierge reportsign_inreturnedok: truewith the requested login in 1.7 s;complete_onboardingreturnedok: true,onboardingModalClosed: truein 2.9 s; ready state about 11 s after startmain(same hour)main(same hour)Offline tests
complete_onboardingok: false, reasonCompleteGuidedSetup never left the queue (offline? the server never saw it); covered by the stuck-queue unit testQA Steps
None: the tools register only in development builds (title carries [NoQA]).
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, I verified the components usingAvatarare working as expected)npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari