Skip to content

LHN - Invited workspace chat still shows GBR after changing role to approve-only #106887

Open

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.5.39-1
Reproducible in staging?: Yes
Reproducible in production?: N/A - new feature, doesn't exist in prod
If this was caught during regression testing, add the test name, ID and link from BrowserStack: #106371
Email or phone of affected tester (no customers): jnsoidsojiosjijsiodjo2@gmail.com
Issue reported by: Applause Internal Team
Bug source: Exploratory - Significant User Experience Deterioration
Device used: Mac 26.5 / Chrome
App Component: Money Requests

Action Performed:

Precondition:

  • User A creates a Control workspace.
  • User A invites User B to workspace.
  • User B creates a workspace and make it default workspace.
  1. Go to staging.new.expensify.com
  2. [User B] Create an expense in the invited workspace chat.
  3. [User A] Change User B's role to Approve-only in workspace settings > Members.
  4. [User B] Reopen the invited workspace chat.

Expected Result:

Workspace chat will not show GBR because Submit button is hidden from the expense report.

Actual Result:

Workspace chat shows GBR when Submit button is hidden from the expense report.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7313398_1794591215972.12.mp4

View all open jobs on GitHub

Applause Internal Information
Exported by: Svetlana Lazutkina
Bug ID: 7313398

Issue OwnerCurrent Issue Owner: @Pujan92

Activity

  1. added
    DeployBlockerCashThis issue or pull request should block deployment
    BugSomething is broken. Auto assigns a BugZero manager.
    on Nov 13, 2026
  2. applause-bot commented on Nov 13, 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/1751df34844fae6f56c87588c05d5dc9cea6d867d3113e8fab727cda38e0fbfb

  3. melvin-bot commented on Nov 13, 2026

    @melvin-bot

    You have been assigned to this deploy blocker because you recently merged this PR: #106371

  4. melvin-bot commented on Nov 13, 2026

    @melvin-bot

    @flodnv you have been assigned to this deploy blocker because you reviewed the offending PR: #106371

  5. melvin-bot commented on Nov 13, 2026

    @melvin-bot

    @ShridharGoel you have been assigned to this deploy blocker because you authored the offending PR: #106371

  6. melvin-bot commented on Nov 13, 2026

    @melvin-bot

    💬 A slack conversation has been started in #expensify-open-source

  7. github-actions commented on Nov 13, 2026

    @github-actions
    Contributor

    👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

    1. Identify the pull request that introduced this issue and revert it.
    2. Find someone who can quickly fix the issue.
    3. Fix the issue yourself.
  8. MelvinBot commented on Nov 13, 2026

    @MelvinBot
    Contributor

    Proposal

    Release recommendation: Revert Enable approve-only role assignment while completing regression coverage. Keep this issue as a deploy blocker.

    What is the root cause of that problem?

    The Submit button and workspace-chat green dot use different eligibility checks. Approve-only correctly disables submission, but the green-dot fallback suppresses outstanding requests only for empty reports. The reported flow creates an expense first, so a nonempty report can retain its dot despite having no Submit action.

    Confidence: Medium-high from code and release evidence; browser reproduction and affected runtime data remain unverified.

    Code and release evidence

    The assignment PR exposes the incomplete fallback; it did not introduce that fallback itself. The remaining assumption is that the affected chat retains hasOutstandingChildRequest: true. No affected Onyx snapshot was captured.

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

    Immediate mitigation: Revert the assignment-enablement PR. This prevents new assignments through that UI, but does not undo existing approve-only assignments or guarantee existing dots disappear.

    Follow-up fix direction: Verify the affected chat’s outstanding-child flag and derived attention reason, then make the fallback respect actionable permissions for nonempty reports too. Preserve legitimate approval actions, sibling reports, tasks, and mentions.

    Validate member → approve-only → member transitions, including reopening and refreshing the chat.

    What alternative solutions did you explore? (Optional)

    Restoring Submit is not appropriate: hiding it is the intended permission restriction. A backend-only explanation is not established because the frontend contains an independent path producing this symptom.

    Related: Home shows “Submit 1 report” after the same role change merits coordinated testing, but a shared root cause is not yet proven.


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


    view run

  9. cocvn157 commented on Nov 14, 2026

    @cocvn157

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    When User B is a workspace member who creates an expense in an invited workspace chat (leaving an open, non-empty expense report with hasOutstandingChildRequest: true on the workspace chat), and User A then changes User B's role to Approve-only (CONST.POLICY.ROLE.APPROVE_ONLY), the Submit button is hidden from the expense report (canSubmitReport returns false), yet the Left Hand Navigation (LHN) row for the workspace chat still displays a Green Brick Road (GBR) indicator.

    What is the root cause of that problem?

    1. In src/libs/ReportUtils.ts:3575-3615, canSubmitReport checks canSubmitOwnReportOnPolicy(policy, currentUserEmailParam):
      const isReportSubmitter = report?.ownerAccountID === currentUserAccountID;
      // A role that cannot create expenses cannot submit its own report.
      const canSubmitOwnReport = !isReportSubmitter || canSubmitOwnReportOnPolicy(policy, currentUserEmailParam);
      When User B's role is changed to CONST.POLICY.ROLE.APPROVE_ONLY, canSubmitOwnReportOnPolicy returns false, so canSubmitReport returns false and getIOUReportActionWithBadge (src/libs/ReportUtils.ts:3618-3730) returns {reportAction: undefined, actionBadge: undefined} (no SUBMIT or ADD badge).
    2. However, in getReasonAndReportActionThatRequiresAttention (src/libs/ReportUtils.ts:5429-5438), the fallback check for optionOrReport.hasOutstandingChildRequest === true only suppresses hasOutstandingChildRequest when (iouReport?.transactionCount ?? 0) === 0:
      // The bare outstanding-child flag only asks the owner to add expenses to their open report, so it is ignored when the current user cannot create expenses on that workspace.
      const isBareOutstandingChildIgnorable =
          !iouReportActionToApproveOrPay?.reportActionID &&
          isOpenExpenseReport(iouReport) &&
          (iouReport?.transactionCount ?? 0) === 0 &&
          iouReport?.ownerAccountID === currentUserAccountID &&
          !canCreateExpensesOnPolicy(resolvePolicy(iouReport?.policyID), currentUserLogin);
      const hasValidIOUAction =
          ((optionOrReport.hasOutstandingChildRequest === true && !hasStaleChildRequest && !isBareOutstandingChildIgnorable) || dotCandidateAction?.reportActionID) &&
          !hasOnlyPendingTransactions &&
          !isFallbackReportExcludedForHeldExpenses;
    3. Because User B created an expense before their role was changed to approve_only, (iouReport?.transactionCount ?? 0) is >= 1 (!== 0). As a result:
      • iouReportActionToApproveOrPay?.reportActionID is undefined (because canSubmitReport is false for approve_only),
      • isBareOutstandingChildIgnorable evaluates to false solely because (iouReport?.transactionCount ?? 0) === 0 is false,
      • hasValidIOUAction evaluates to true via optionOrReport.hasOutstandingChildRequest === true, causing getReasonAndReportActionThatRequiresAttention (src/libs/ReportUtils.ts:5492-5497) to return CONST.REQUIRES_ATTENTION_REASONS.HAS_CHILD_REPORT_AWAITING_ACTION and show the GBR dot on the workspace chat in the LHN even though User B can neither add expenses nor submit the open expense report.

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

    Remove the (iouReport?.transactionCount ?? 0) === 0 restriction from isBareOutstandingChildIgnorable in src/libs/ReportUtils.ts:5429-5435:

    When !iouReportActionToApproveOrPay?.reportActionID (meaning getIOUReportActionWithBadge already verified that there is no actionable SUBMIT, APPROVE, PAY, or ADD action for the current user across the chat's child reports), and the fallback iouReport is an open expense report (isOpenExpenseReport(iouReport)) owned by currentUserAccountID on a policy where !canCreateExpensesOnPolicy(resolvePolicy(iouReport?.policyID), currentUserLogin) (or !canSubmitOwnReportOnPolicy), the current user cannot add expenses to or submit that open report regardless of whether transactionCount is 0 or > 0:

    // When no actionable IOU badge action was found and the open child report belongs to the current user,
    // ignore the bare outstanding-child flag if the user's role cannot create/submit expenses on that workspace.
    const isBareOutstandingChildIgnorable =
        !iouReportActionToApproveOrPay?.reportActionID &&
        isOpenExpenseReport(iouReport) &&
        iouReport?.ownerAccountID === currentUserAccountID &&
        !canCreateExpensesOnPolicy(resolvePolicy(iouReport?.policyID), currentUserLogin);

    What alternative solutions did you explore? (Optional)

    • Reverting PR #106371: Unnecessary because #106371 intentionally enabled the Approve-only role, and this GBR mismatch is caused by the overly narrow (iouReport?.transactionCount ?? 0) === 0 check in isBareOutstandingChildIgnorable (src/libs/ReportUtils.ts:5432).
    • Also checking ONYXKEYS.DERIVED.REPORT_ATTRIBUTES dependencies: src/libs/actions/OnyxDerived/configs/reportAttributes.ts already subscribes to ONYXKEYS.COLLECTION.POLICY and passes policies into getReasonAndReportActionThatRequiresAttention, so removing (iouReport?.transactionCount ?? 0) === 0 immediately updates requiresAttention and clears the LHN GBR as soon as the member's role changes to approve_only.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

BugSomething is broken. Auto assigns a BugZero manager.EngineeringHourlyKSv2ReviewingHas a PR in review

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions