Skip to content

[$175] Workflow-The approver selected while inviting a member not save if default approver not owner #108618

Todo

Description

@applause-bot

If you haven’t already, check out our contributing guidelines for onboarding. To join our Slack channel, fill out this form.


Version Number: v9.5.57-0
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught during regression testing, add the test name, ID and link from BrowserStack: https://test-management.browserstack.com/projects/2219752/test-runs/179762450/folder/57610056/99825106/4952492045?sort=-identifier
Email or phone of affected tester (no customers): lekima20+applause61512@gmail.com
Issue reported by: Applause Internal Team
Bug source: Regression TC Execution
Device used: Win 11/Chrome
App Component: Workspace Settings

Action Performed:

Precondition:

  • Create a control workspace, add 3 members
  • At default approval set the first member is approver
  • At advance approval set Expense from: the first member, Approver: owner
  1. Open https://staging.new.expensify.com
  2. Navigate to the workspace setting > Members
  3. Click Invite member
  4. Select a user from the list or search for a user and tap Next
  5. Click on Approver row
  6. Select the second member > Invite
  7. Click on the new invited member observe the approver
  8. Navigate to Workflows > Approvals observe the workflow

Expected Result:

Verify that the Approver row displays the newly selected member and new Approval flow is created

Actual Result:

Approver row displays the default approver and no new Approval flow is created

Workaround:

Unknown

Platforms:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome Safari

Screenshots/Videos

Bug7328921_1796181287234.Recording__2747.mp4

View all open jobs on GitHub

Applause Internal Information
Exported by: Mita Rachim
Bug ID: 7328921

Upwork Automation - Do Not Edit

Activity

  1. applause-bot commented on Dec 2, 2026

    @applause-bot
    Author

    While Applause doesn't embed attachments for this bug, here are the links for quick view:
    https://platform.applause.com/services/links/v1/external/e72d481aa1f7b705a6368525e11eeab26a330ffe5feea302ff5e61e860af8a64

  2. added
    Daily
    Bug
    on Dec 2, 2026
  3. added
    External
    on Dec 2, 2026
  4. expensify-chore-bot commented on Dec 2, 2026

    @expensify-chore-bot

    Triggered auto assignment to Contributor-plus team member for initial proposal review - @huult (External)

  5. changed the title [-]Workflow-The approver selected while inviting a member not save if default approver not owner[/-] [+][$175] Workflow-The approver selected while inviting a member not save if default approver not owner[/+] on Dec 2, 2026
  6. expensify-chore-bot commented on Dec 2, 2026

    @expensify-chore-bot
  7. MelvinBot commented on Dec 2, 2026

    @MelvinBot
    Contributor

    ⚠️ Preliminary analysis (low confidence) — the reported root cause is not yet verified.

    Findings

    The current frontend preserves the selected approver rather than replacing it with the workspace default:

    Code evidence

    Alternative explanation: Approval-mode filtering can hide a nondefault workflow and display its members under the default approver, even if their stored selection remains correct: WorkflowUtils.ts:809–829. This could explain both symptoms, but the affected workspace’s approval mode is unknown.

    Evidence needed before recommending a fix

    Capture the failing invitation’s request, response, and resulting workspace state:

    • Does employees[].submitsTo contain the selected approver?
    • Does the invited member retain that value after the response?
    • What are the workspace’s approvalMode and applicable approval rules?

    These distinguish selection loss, server-side replacement, and display filtering. Production logs were unavailable, and the reported release was not verified against the current checkout.

    Possibly related issues

    These concern adjacent invitation/workflow behavior, not confirmed duplicates:

    🤖 Web test steps verification results: ⚠️ partial

    Web verification was blocked before reproducing the issue: the Control workspace was created, but inviting the prerequisite members left only the owner in Members. This does not establish whether the reported approver bug occurs.

    Members lists only the owner after inviting A/B/C

    Step Status
    Create prerequisite workspace and membersControl plan confirmed, but Members showed only the owner after invitations; default approver and custom flow could not be configured.
    Members lists only the owner after inviting A/B/C
    ❌
    Invitation confirmation shows selected approver BNot verified: prerequisite setup failed.
    ❌
    Invited member retains approver BNot verified: member D was not invited.
    ❌
    Approvals shows D → B and preserves the existing flowNot verified: required members and workflow were unavailable.
    ❌
    Verify stored submitsTo and reload persistenceNot verified: request/response bodies were unavailable, and session rules prohibited reload.
    ❌

    view run · view recording

  8. yusufdeveloper2903 commented on Dec 2, 2026

    @yusufdeveloper2903
    Contributor

    @huult Melvin's analysis leaves open whether the pick is lost, filtered or replaced, but the reporter's video settles it: right after Invite the new member is listed under the picked approver (0:16), and once the server data arrives they move to the default approver (0:17). The code notes that the backend puts the members it adds into the default workflow, which is why the spreadsheet import follows up with a rules save, while the invite sends the pick only as submitsTo and saves no rule:

    // The backend puts the members it adds in the default workflow, so they can only be moved to their own workflows once they're in.
    // Members whose approvers are unchanged are left out: rewriting them would take them out of their workflow's rules first, which
    // deletes those rules once every member is out, the default workflow's included.
    importApprovalWorkflowRules({
    policy,
    rules,
    members: members.flatMap((member) => (member.approvers && hasApproversChange(member) ? [{email: member.email, approvers: member.approvers}] : [])),
    addedMemberEmails: members.filter((member) => !policy.employeeList?.[member.email]).map((member) => member.email),
    currentUserLogin,
    });

    Changing the default approver away from the owner is what gives the default workflow rules of its own, so from then on those rules win over the invite's submitsTo and no new workflow appears. Saving a rule for the invited members after the invite, the way the import already does, keeps the choice without changing addMembersToWorkspace or its other caller.

    Happy to put up a full proposal for this if that's useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

BugDailyExternal

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions