You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[$175] Gusto-Setting defaulted to "Manager approval" instead of "Custom approval" #103307
Version Number: 9.5.4-0 Reproducible in staging?: Yes Reproducible in production?: Unable to validate in Prod - Provide reasoning. If this was caught during regression testing, add the test name, ID and link from BrowserStack:#102750 Email or phone of affected tester (no customers): N/A Issue reported by: Applause Internal Team Bug source: Pull Request QA execution Device used: Windows 11 / Chrome, iPhone 13 / iOS 27 Beta, Samsung Galaxy A52 / Android 14 App Component: Workspace Settings
Action Performed:
Preconditions:
logged in to a new gmail account
create a workspace, invite 2 members to the workspace
Steps:
Go to workflow in workspace setting
Navigate to approval in workflow, disable and enable the approval
Click edit on default workflow, add a second approver
Add another approval workflow that will create 2 approvers
Go to more features, enable HR
Connect Gusto in HR
Close the gusto sync complete RHP page
Observe the approval mode
Expected Result:
it should starts with a Custom approval setting as default
Actual Result:
it starts with a Manager approval setting as default
Root Cause: The App does not choose the Gusto approval mode. It only displays the approvalMode value stored on the policy (GustoApprovalModePage.tsx:31). "Manager approval" appears because the backend saved APPROVAL_ADVANCED when Gusto connected. This appears to be a backend/internal issue. A separate internal investigation is needed.
Recommended Fix: The fix requires changes outside the App repo. Please escalate to an internal engineer with backend access. No App code change is recommended.
Investigation details
How the App picks the selected option
HRApprovalModePageBase.tsx:71-73 selects draftApprovalMode ?? currentApprovalMode. Each option is selected by a plain equality check.
Mode values are in CONST/index.ts:3420-3426. MANAGER maps to APPROVAL_ADVANCED, and CUSTOM maps to APPROVAL_MANUAL.
The App has no fallback to Manager. If the value were empty, the page would select nothing and the HR card would show "Not set".
The App never infers "Custom" from existing approval workflows.
Connect and sync flow
Connecting Gusto only opens a backend link (Gusto.ts:17-24). It sends no optimistic approvalMode.
The sync-complete page only reads sync result counts.
The App writes approvalMode only when the user presses Save on the approval mode page (Gusto.ts:26).
With the beta on, workflows are saved as approval rules.
With the beta off, workflows are saved on the member list.
The reviewer of [Payment due @mkhutornyi] Keep approval workflow rules working with HR integrations saw Gusto start in Custom mode. Test step 5 there checks approval "rules", which suggests the beta was on. QA used a new Gmail account, which probably does not have the beta. If the backend picks Custom only when approval rules exist, that account would get Manager. An internal engineer should confirm what the backend checks and whether the QA account has the beta.
Alternatives considered
An App-side default to Manager: none exists.
The sync-complete page overwriting the mode: it does not touch approvalMode.
changed the title [-]Gusto-Setting defaulted to "Manager approval" instead of "Custom approval"[/-][+][$175] Gusto-Setting defaulted to "Manager approval" instead of "Custom approval"[/+]on Oct 7, 2026
Please re-state the problem that we are trying to solve in this issue.
When a workspace already has custom approval workflows configured (e.g. multiple approvers or custom rules) and Gusto is connected via Workspace Settings > More features > HR, the Gusto approval mode is displayed and defaulted to "Manager approval" instead of preserving "Custom approval".
What is the root cause of that problem?
In PR #102750, support was added to keep approval workflow rules working with HR integrations (hasApprovalWorkflowRules). However:
In src/pages/workspace/hr/utils.ts and src/pages/workspace/hr/HRApprovalModePageBase.tsx:
When Gusto is newly connected, approvalMode is not yet explicitly set in the connection config.
getHRApprovalMode in src/libs/merge/HRUtils.ts falls back to null, and getApprovalModeLabel or default selection fails to inspect whether the workspace already has custom approval workflow rules.
As a result, the UI falls back to the default HR provider behavior, showing "Manager approval", which risks deleting existing custom workflow rules upon saving.
What changes do you think we should make in order to solve the problem?
Update getHRApprovalMode in src/libs/merge/HRUtils.ts:
Accept rulesCollection?: OnyxCollection<Rule> (or policyID) and default unconfigured HR connections to CUSTOM if the workspace has active approval workflow rules:
functiongetHRApprovalMode(policy?: OnyxEntry<Policy>,connectionName?: HRConnectionName,rules?: OnyxCollection<Rule>,): ValueOf<typeofCONST.GUSTO.APPROVAL_MODE>|ValueOf<typeofCONST.ZENEFITS.APPROVAL_MODE>|MergeApprovalMode|null{if(!connectionName||!policy?.connections){returnnull;}constconfiguredMode=policy.connections[connectionName]?.config?.approvalMode;if(configuredMode){returnconfiguredMode;}// If the workspace already has custom approval workflow rules, default to CUSTOM approvalif(hasApprovalWorkflowRules(rules,policy?.id)){returnCONST.GUSTO.APPROVAL_MODE.CUSTOM;}returnnull;}
In src/pages/workspace/hr/HRApprovalModePageBase.tsx:
Pass rules to derive currentApprovalMode so that if no approval mode was explicitly stored yet on the connection, it correctly preselects CUSTOM:
What alternative solutions did you explore? (Optional)
Only changing the display label in utils.ts: Insufficient because HRApprovalModePageBase would still stage MANAGER mode upon save, triggering the prompt to delete workflow rules.
What specific scenarios should we cover in automated tests?
In tests/unit/WorkflowUtilsTest.ts and tests/unit/HRConnectionActionTest.ts:
Workspace with 2+ approvers (custom workflow rules) connecting Gusto defaults to CUSTOM approval mode.
Workspace with default/single approver without custom rules defaults to standard manager or basic mode.
Verify that saving in custom mode does not delete approval workflow rules in Onyx.
@MonilBhavsar Unable to connect to Gusto and locked your message displayed, Used the following credentials for 1Password expensify@gustodemo.com Could you please look in to this?
📣 @jeff-graham-ai! 📣
Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
Please follow these steps:
Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>
Activity
applause-bot commentedon Oct 7, 2026
While Applause doesn't embed attachments for this bug, here are the links for quick view:
https://platform.applause.com/services/links/v1/external/19890865fab07280f4eb62ac479cfea3d838d24b31c2bcb406b35855e055a9fa
MelvinBot commentedon Oct 7, 2026
Issue Analysis
Root Cause: The App does not choose the Gusto approval mode. It only displays the
approvalModevalue stored on the policy (GustoApprovalModePage.tsx:31). "Manager approval" appears because the backend savedAPPROVAL_ADVANCEDwhen Gusto connected. This appears to be a backend/internal issue. A separate internal investigation is needed.Recommended Fix: The fix requires changes outside the App repo. Please escalate to an internal engineer with backend access. No App code change is recommended.
Investigation details
How the App picks the selected option
draftApprovalMode ?? currentApprovalMode. Each option is selected by a plain equality check.MANAGERmaps toAPPROVAL_ADVANCED, andCUSTOMmaps toAPPROVAL_MANUAL.Connect and sync flow
approvalMode.approvalModeonly when the user presses Save on the approval mode page (Gusto.ts:26).Possible trigger (unconfirmed)
Approval workflows are saved in two formats, depending on the
multipleApproversbeta (WorkspaceWorkflowsApprovalsCreatePage.tsx:78-82):The reviewer of [Payment due @mkhutornyi] Keep approval workflow rules working with HR integrations saw Gusto start in Custom mode. Test step 5 there checks approval "rules", which suggests the beta was on. QA used a new Gmail account, which probably does not have the beta. If the backend picks Custom only when approval rules exist, that account would get Manager. An internal engineer should confirm what the backend checks and whether the QA account has the beta.
Alternatives considered
approvalMode.Related open issues:
Next Steps: Reply with
@MelvinBot <your feedback>to refine this analysis.melvin-bot commentedon Oct 7, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @thelullabyy (
External)[-]Gusto-Setting defaulted to "Manager approval" instead of "Custom approval"[/-][+][$175] Gusto-Setting defaulted to "Manager approval" instead of "Custom approval"[/+]melvin-bot commentedon Oct 7, 2026
Job added to Upwork: https://www.upwork.com/jobs/~022107779832826515888
yuvrajangadsingh commentedon Oct 7, 2026
withdrawing this, it went up before the issue had the
Help Wantedlabel. will come back if the label is added.jloa-dev commentedon Oct 11, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
When a workspace already has custom approval workflows configured (e.g. multiple approvers or custom rules) and Gusto is connected via Workspace Settings > More features > HR, the Gusto approval mode is displayed and defaulted to "Manager approval" instead of preserving "Custom approval".
What is the root cause of that problem?
In PR #102750, support was added to keep approval workflow rules working with HR integrations (
hasApprovalWorkflowRules). However:src/pages/workspace/hr/utils.tsandsrc/pages/workspace/hr/HRApprovalModePageBase.tsx:getCurrentApprovalModereadspolicy?.connections?.gusto?.config?.approvalMode.approvalModeis not yet explicitly set in the connection config.getHRApprovalModeinsrc/libs/merge/HRUtils.tsfalls back tonull, andgetApprovalModeLabelor default selection fails to inspect whether the workspace already has custom approval workflow rules.What changes do you think we should make in order to solve the problem?
Update
getHRApprovalModeinsrc/libs/merge/HRUtils.ts:Accept
rulesCollection?: OnyxCollection<Rule>(or policyID) and default unconfigured HR connections toCUSTOMif the workspace has active approval workflow rules:In
src/pages/workspace/hr/HRApprovalModePageBase.tsx:Pass
rulesto derivecurrentApprovalModeso that if no approval mode was explicitly stored yet on the connection, it correctly preselectsCUSTOM:In
src/pages/workspace/hr/gusto/GustoApprovalModePage.tsx:Update
getCurrentApprovalModeconfig signature to support rule detection:What alternative solutions did you explore? (Optional)
utils.ts: Insufficient becauseHRApprovalModePageBasewould still stageMANAGERmode upon save, triggering the prompt to delete workflow rules.What specific scenarios should we cover in automated tests?
In
tests/unit/WorkflowUtilsTest.tsandtests/unit/HRConnectionActionTest.ts:CUSTOMapproval mode.melvin-bot commentedon Oct 12, 2026
@thelullabyy Huh... This is 4 days overdue. Who can take care of this?
thelullabyy commentedon Oct 13, 2026
Asking for testing account on slack https://expensify.slack.com/archives/C02NK2DQWUX/p1791858670777399
19 remaining items
melvin-bot commentedon Nov 3, 2026
@MonilBhavsar 12 days overdue now... This issue's end is nigh!
MonilBhavsar commentedon Nov 3, 2026
Exported to BEC
melvin-bot commentedon Nov 3, 2026
@MonilBhavsar 12 days overdue now... This issue's end is nigh!
melvin-bot commentedon Nov 4, 2026
@MonilBhavsar @thelullabyy this issue is now 4 weeks old, please consider:
Thanks!
m-natarajan commentedon Nov 5, 2026
@MonilBhavsar Unable to connect to Gusto and locked your message displayed, Used the following credentials for 1Password
expensify@gustodemo.com Could you please look in to this?
MonilBhavsar commentedon Nov 5, 2026
@m-natarajan i can login. Can you retry
m-natarajan commentedon Nov 6, 2026
@MonilBhavsar Issue not repro in Win11/Chrome, v9.5.32-7
Please note still the credentials (expensify@gustodemo.com) not working, used the other credentials(francois@expensify.com) to validate the test
Recording.3793.mp4
MonilBhavsar commentedon Nov 7, 2026
Thanks!! Closing
melvin-bot commentedon Nov 8, 2026
📣 @jeff-graham-ai! 📣
Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
Please follow these steps:
Format: