Skip to content

[Due for payment 2026-10-20] [$175] WS - Approver row incorrectly appears or is missing based on how the workspace is upgraded #99749

Closed

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: 9.4.63-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: 1. https://test-management.browserstack.com/projects/2219752/test-runs/71240654/folder/53696879/99825106/1704263019 2. https://test-management.browserstack.com/projects/2219752/test-runs/71240654/folder/53697042/99825818/1704263020
Email or phone of affected tester (no customers): applausetester+bm890012@applause.expensifail.com
Issue reported by: Applause Internal Team
Bug source: Regression TC Execution
Device used: Web, android
App Component: Workspace Settings

Action Performed:

Preconditions:
Use expensifail account.

  1. Go to staging.new.expensify.com
  2. Create a Control workspace (or upgrade to Control in Overview).
  3. Add a few members.
  4. Go to Workflows > Add approval workflow, and create a workflow with a submitter and approver.
  5. Go to Members > Invite member > select a member, and proceed to the confirmation page.
  6. Create a Collect workspace
  7. Go to Workflows > Add approval workflow > upgrade the workspace to Control, then go back without creating a workflow.
  8. Go to Members > Invite member > select a member, and proceed to the confirmation page.

Expected Result:

Step 5: The Approver row should appear because the workspace is on the Control plan and has multiple approval workflows configured.

Step 8: The Approver row should not appear because no custom approval workflow was created.

Actual Result:

Step 5: The Approver row does not appear on the confirmation page, even though the workspace is on the Control plan and has a custom approval workflow in addition to the default workflow.

Step 8: The Approver row appears on the confirmation page even though no custom approval workflow was created. The workspace was only upgraded through the Workflows flow.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7244856_1787893291658.bandicam_2026-08-28_08-00-17-057.mp4

View all open jobs on GitHub

Applause Internal Information
Exported by: Nathan Lemma
Bug ID: 7244856

Issue OwnerCurrent Issue Owner: @mallenexpensify
Upwork Automation - Do Not Edit

Activity

  1. added
    Daily
    Bug
    on Aug 28, 2026
  2. applause-bot commented on Aug 28, 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/b3c533c23fc463cce551bc4922ff70edfe2450b9466ccef399def4bebdad02e0

  3. MelvinBot commented on Aug 28, 2026

    @MelvinBot
    Contributor

    Proposal

    What is the root cause of that problem?

    The Approver row on the invite-confirmation page is gated only by the stored policy.approvalMode flag:

    WorkspaceInviteMessageComponent.tsx:121

    const shouldShowApproverRow = isControl && policy?.approvalMode === CONST.POLICY.APPROVAL_MODE.ADVANCED && policy?.areWorkflowsEnabled;

    approvalMode === ADVANCED is treated as a proxy for "this workspace has a custom approval workflow", but that flag is written optimistically by many different code paths and drifts from the real workflow structure. So it points the wrong way in both reported scenarios:

    • Step 5 — row missing (has a custom workflow): With the MULTIPLE_APPROVERS beta on, creating a workflow goes through the rules path (createApprovalWorkflowRules → setApprovalWorkflowRules), which writes only to the RULE collection and never sets approvalMode = ADVANCED. Only the legacy employeeList path sets it (Workflow.ts:82). So approvalMode stays BASIC/OPTIONAL, the gate fails, and the row is missing.
    • Step 8 — row wrongly appears (no custom workflow): The App-side upgrade (upgradeToCorporate) only flips type to CORPORATE; the ADVANCED value on the upgraded Collect workspace comes from the backend upgrade response, and areWorkflowsEnabled was already true — so both gate conditions become true even though no workflow was ever created.

    This is a known-fragile check: the same shouldShowApproverRow/approvalMode coupling already caused Deploy Blocker #83474, and maintainers have been patching the writers of approvalMode rather than fixing the read-side gate.

    What changes do you think we should make in order to solve the problem?

    Stop trusting the stored approvalMode flag on the invite page and derive whether a custom workflow exists, exactly like the Workflows tab already does. WorkflowsApprovalsTab computes advanced-ness from the actual workflows (WorkflowsApprovalsTab.tsx:161-162):

    const isAdvanceApproval = (approvalWorkflows.length > 1 || (approvalWorkflows?.at(0)?.approvers ?? []).length > 1) && isControlPolicy(policy);

    Extract that into a shared PolicyUtils helper (deriving workflows via convertPolicyEmployeesToApprovalWorkflows, or convertApprovalWorkflowRulesToWorkflows when the beta is on) and reuse it for shouldShowApproverRow, so the invite page and the Workflows tab can never disagree. This fixes both scenarios at once and removes the class of drift bugs instead of chasing individual writers.

    What alternative solutions did you explore? (Optional)

    • Also set approvalMode = ADVANCED in the rules-based create path — fixes Step 5 only, leaves Step 8 (backend-set ADVANCED on bare upgrade) broken, and keeps the fragile proxy.
    • Confirm on the backend why UpgradeToCorporate returns approvalMode = ADVANCED for a workspace with no custom workflow (source of Step 8's ADVANCED). Worth verifying, but the robust fix lives in App regardless of the backend answer.
    Investigation details & evidence

    Possibly related: #99208 (approval workflow appears to save then disappears) — separate symptom, but also in the approval-workflow persistence area.


    Next Steps for Contributor+ team:
    To accept: @MelvinBot implement [this](https://github.com/Expensify/App/issues/99749) to create a draft PR.
    To refine: @MelvinBot <your feedback>
    To reject: Explain why you are rejecting Melvin's proposal.


    view run

  4. added
    External
    on Aug 28, 2026
  5. melvin-bot commented on Aug 28, 2026

    @melvin-bot

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

  6. melvin-bot commented on Aug 28, 2026

    @melvin-bot

    Unable to auto-create job on Upwork. The BZ team member should create it manually for this issue.

  7. melvin-bot commented on Aug 31, 2026

    @melvin-bot

    @situchan Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

  8. melvin-bot commented on Sep 2, 2026

    @melvin-bot

    @situchan Huh... This is 4 days overdue. Who can take care of this?

  9. melvin-bot commented on Sep 3, 2026

    @melvin-bot

    @situchan Eep! 4 days overdue now. Issues have feelings too...

  10. melvin-bot commented on Sep 3, 2026

    @melvin-bot

    @situchan Huh... This is 4 days overdue. Who can take care of this?

  11. situchan commented on Sep 3, 2026

    @situchan
    Contributor

    @MelvinBot's proposal looks good.
    🎀 👀 🎀 C+ reviewed

  12. 29 remaining items

  13. changed the title [-][$175] WS - Approver row incorrectly appears or is missing based on how the workspace is upgraded[/-] [+][Due for payment 2026-10-20] [$175] WS - Approver row incorrectly appears or is missing based on how the workspace is upgraded[/+] on Oct 13, 2026
  14. melvin-bot commented on Oct 13, 2026

    @melvin-bot

    @situchan

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.5.7-3 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

    If no regressions arise, payment will be issued on 2026-10-20. 🎊

    The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the Contributor+ Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]. If no checklist is needed for this issue, you can click: [no checklist button]

  15. melvin-bot commented on Oct 14, 2026

    @melvin-bot

    @situchan 6 days overdue. This is scarier than being forced to listen to Vogon poetry!

  16. melvin-bot commented on Oct 16, 2026

    @melvin-bot

    @situchan 8 days overdue is a lot. Should this be a Weekly issue? If so, feel free to change it!

  17. added
    Awaiting Payment
    on Oct 19, 2026
  18. melvin-bot commented on Oct 19, 2026

    @melvin-bot

    Triggered auto assignment to @mallenexpensify (Awaiting Payment)

  19. melvin-bot commented on Oct 19, 2026

    @melvin-bot

    Payment Summary

    Resolving PRs:

    BugZero Checklist (@mallenexpensify)

    • I have confirmed assignees, roles, and Upwork contracts look correct
    • I have paid out Upwork contracts / manual NewDot requests
    • [BugZero Assignee] I have created a GH issue for creating/updating the regression test once above steps have been agreed upon
  20. mallenexpensify commented on Oct 20, 2026

    @mallenexpensify
    Contributor

    Payment Summary

    Contributor+: @situchan due $250 via NewDot

    @situchan plz complete the Contributor+ checklist and tag me in a post once you have. Thx

  21. situchan commented on Oct 20, 2026

    @situchan
    Contributor

    Contributor+ Checklist:

    • [Contributor] The offending PR and associated issue have been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.

      Link to the comment on the PR:
      Link to the comment on the Issue:

    • [Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.

      Link to discussion:

    • [Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.

    Regression Test Proposal

    Test:

    1. Create a Control workspace (or upgrade to Control in Overview).
    2. Add a few members.
    3. Go to Workflows > Add approval workflow, and create a workflow with a submitter and approver.
    4. Go to Members > Invite member > select a member, and proceed to the confirmation page.
    5. Verify the Approver row appears.
    6. Create a Collect workspace.
    7. Go to Workflows > Add approval workflow > upgrade the workspace to Control, then go back without creating a workflow.
    8. Go to Members > Invite member > select a member, and proceed to the confirmation page.
    9. Verify the Approver row does not appear.

    Do we agree 👍 or 👎

  22. trjExpensify commented on Nov 3, 2026

    @trjExpensify
    Contributor

    approved $250 for @situchan

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

Metadata

Metadata

Labels

Awaiting PaymentBugDailyExternal

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions