Skip to content

Spend -Modal with how many report were moved to another workspace is only displayed briefly #106599

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.36-0
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: #104295
Email or phone of affected tester (no customers): ibellicotest+3215@gmail.com
Issue reported by: Applause Internal Team
Bug source: Exploratory - Significant User Experience Deterioration
Device used: Motorola MotoG60 / Android 12 (Hybrid app) - Windows 11 / Chrome
App Component: Search

Action Performed:

Prerequisite: Account has at least two workspaces.
Prerequisite 2: At least one report created in a workspace chat.

  1. Open the staging.new.expensify.com website.
  2. Navigate to "Spend" > "Reports"
  3. Select a report > "Change Workspace"
  4. Select the workspace where report will be moved > "Save"
  5. Click on "Message me when it´s done"
  6. When "You Bet" modal appears, wait until report is moved, without closing it.
  7. Note that a modal showing how many reports were moved, appears only for a brief time.

Expected Result:

Modal showing how many reports were moved to another workspace should not disappear automatically.

Actual Result:

Modal showing how many reports were moved to another workspace is only displayed briefly.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7310749_1794366733028.Changed.mp4

View all open jobs on GitHub

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

Issue OwnerCurrent Issue Owner: @allgandalf

Activity

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

  3. melvin-bot commented on Nov 11, 2026

    @melvin-bot

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

  4. melvin-bot commented on Nov 11, 2026

    @melvin-bot

    @JS00001 @mollfpr @Eskalifer1 you have been assigned to this deploy blocker because you reviewed the offending PR: #104295

  5. melvin-bot commented on Nov 11, 2026

    @melvin-bot

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

  6. github-actions commented on Nov 11, 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.
  7. melvin-bot commented on Nov 11, 2026

    @melvin-bot

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

  8. MelvinBot commented on Nov 11, 2026

    @MelvinBot
    Contributor

    🤖 Web test steps verification results: ⚠️ partial

    On dev NewDot web, the report moved successfully, but no completion modal remained after clicking “Message me when it’s done,” without explicit dismissal. “You bet” was not captured, so its exact appearance/flash timing remains unverified.

    Report showing destination workspace and successful workspace-change history

    Step Status
    1. Open the appVerified in the authenticated dev web session, not staging.
    ✅
    2. Navigate Spend > ReportsNavigation confirmed.
    ✅
    3. Select a report > Change WorkspaceSelected a workspace-linked report and opened Change workspace.
    ✅
    4. Select destination workspace > SaveSelected the second workspace and saved. “Moving reports...” appeared.
    ✅
    5. Click “Message me when it’s done”Click succeeded; SendBulkActionSummaryFromConcierge returned HTTP 200.
    ✅
    6. Leave “You bet” open until completionNo explicit dismissal occurred, but “You bet” was not captured. Its appearance and timing remain unverified.
    ⚠️
    7. Completion/count modal remains until explicitly dismissedThe subsequent snapshot contained no modal, although the report moved successfully. This supports the persistence failure, but does not establish whether the modal flashed or never rendered.

    Investigation: The requested deploy-blocker investigator identified Add Change workspace to Search bulk actions as the new entry point, included in the staging deployment. Its new action queues Change Workspace through the shared bulk-status UI.

    Likely mechanism — medium confidence: The modal switches from Concierge acknowledgement to results on DONE. If the backing record subsequently disappears, the manager unmounts it. Record deletion was not observed, so that final causal link remains unconfirmed.

    Attribution: The shared lifecycle predates Change Workspace: it already exists in the original status-modal implementation. The new feature exposes it; it did not introduce those lifecycle conditions.

    Recommendation: Keep the deploy blocker. Revert the Change Workspace PR as containment unless a verified fix is ready. Before implementing a permanent fix, capture the DONE/removal sequence and confirm intended Concierge behavior. If removal is confirmed, preserve the displayed terminal result independently until explicit dismissal, covering both parent and child unmount conditions. No code changes or revert were made.
    Reports list after notification request, with no completion modal
    Report showing destination workspace and successful workspace-change history
    ❌

    view run · view recording

  9. mollfpr commented on Nov 11, 2026

    @mollfpr
    Contributor

    This is minor, so I'm removing the blocker label. We can fix it separately.

  10. added and removed
    DeployBlockerCashThis issue or pull request should block deployment
    on Nov 11, 2026
  11. Eskalifer1 commented on Nov 11, 2026

    @Eskalifer1
    Contributor

    Agree this is minor, we can fix it in follow-up

  12. Eskalifer1 commented on Nov 11, 2026

    @Eskalifer1
    Contributor

    I did some digging and I don't think this is a regression from #104295. The "You bet!" modal (BulkActionStatusModal) is the shared status modal that every "Select all" bulk action (Approve, Submit, Pay, Change workspace) uses. It was already implemented in that PR, so the problem is in the modal itself and needs to be fixed there, not in the Change workspace flow.

    This may also be fixed together with the issue I described in point 4 of my review @allgandalf (#104295 (comment)) replied that it is the status modal every Select all action uses and that it will be handled in a follow-up, since it isn't directly related to the Change workspace flow.

    cc: @mollfpr

  13. cocvn157 commented on Nov 15, 2026

    @cocvn157

    Proposal

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

    When a user starts a bulk action (such as Change Workspace or any "Select all" bulk action), clicks "Message me when it's done" (sendBulkActionSummaryFromConcierge), and leaves the "You bet!" (BulkActionConcierge) modal open without dismissing it, once the bulk action finishes on the backend, the modal briefly flashes the "Moved N report(s)" (BulkActionDone) view and then immediately disappears on its own instead of either staying on the "You bet!" confirmation modal or remaining open until the user explicitly dismisses it.

    What is the root cause of that problem?

    The brief flash and auto-disappearance happen because of a two-step transition in src/components/BulkActionStatusModal.tsx and src/components/BulkActionStatusManager.tsx when shouldSendFromConcierge is true:

    1. Why the modal switches from "You bet!" (BulkActionConcierge) to "Moved N report(s)" (BulkActionDone) when state becomes DONE:
      In src/components/BulkActionStatusModal.tsx:

      const shouldSendFromConcierge = !!displayedBulkAction?.shouldSendFromConcierge;
      const isRunning = state === CONST.BULK_ACTION.STATE.RUNNING && !shouldSendFromConcierge;
      const isConcierge = shouldSendFromConcierge && state !== CONST.BULK_ACTION.STATE.DONE;
      ...
      {isConcierge && <BulkActionConcierge onClose={onClose} />}
      {state === CONST.BULK_ACTION.STATE.DONE && (
          <BulkActionDone
              action={action}
              total={displayedBulkAction?.total ?? 0}
              failedReportIDs={displayedBulkAction?.failedReportIDs ?? []}
              onClose={onClose}
          />
      )}

      When the user clicks "Message me when it's done", sendBulkActionSummaryFromConcierge sets shouldSendFromConcierge: true optimistically in Onyx (src/libs/actions/BulkAction.ts, line 55) and queues WRITE_COMMANDS.SEND_BULK_ACTION_SUMMARY_FROM_CONCIERGE.

      • If the bulk action is only 1 report (or finishes quickly while SEND_BULK_ACTION_SUMMARY_FROM_CONCIERGE is still in flight or before the backend clears the record), the Pusher update from the finished bulk action job arrives first with {state: 'done', total: 1} merged into bulkAction_<id>.
      • Because isConcierge has state !== CONST.BULK_ACTION.STATE.DONE and state === CONST.BULK_ACTION.STATE.DONE does not check !shouldSendFromConcierge, the open modal switches from <BulkActionConcierge /> ("You bet!") to <BulkActionDone /> ("Moved 1 of 1 report").
    2. Why the modal then immediately unmounts / disappears a moment later:

      • As soon as WRITE_COMMANDS.SEND_BULK_ACTION_SUMMARY_FROM_CONCIERGE finishes (or the backend sends the Concierge summary message for the completed bulk action), the backend deletes the bulkAction_<id> record (onyxMethod: SET, value: null) because Concierge has already messaged the summary and the record should not resurface on reload.
      • When bulkActions['bulkAction_<id>'] becomes null / undefined in Onyx, look at src/components/BulkActionStatusManager.tsx:
        if (openBulkActionID && !bulkActions?.[`${ONYXKEYS.COLLECTION.BULK_ACTION}${openBulkActionID}`]) {
            setOpenBulkActionID(undefined);
        }
        ...
        const bulkAction = bulkActions?.[`${ONYXKEYS.COLLECTION.BULK_ACTION}${openBulkActionID}`];
        if (!bulkAction) {
            return null;
        }
        And in src/components/BulkActionStatusModal.tsx:
        const displayedBulkAction = usePreviousDefined(bulkAction);
        if (!bulkAction && !!displayedBulkAction) {
            return null;
        }
        Because the Onyx record is deleted by the backend once Concierge sends the summary, BulkActionStatusManager immediately sets openBulkActionID to undefined and returns null, abruptly closing the modal while the user is looking at it!

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

    We should preserve the active modal's last known BulkAction snapshot while openBulkActionID is open until the user explicitly dismisses or closes it (handleClose / Go to Concierge / Close):

    1. In src/components/BulkActionStatusManager.tsx:

      • Do not clear openBulkActionID automatically when bulkActions[onyxKey] is deleted by the backend while the modal is still open on screen (or store/preserve the last defined bulkAction for openBulkActionID via usePreviousDefined(bulkActions?.[${ONYXKEYS.COLLECTION.BULK_ACTION}${openBulkActionID}])).
      • Only clear openBulkActionID (setOpenBulkActionID(undefined)) inside handleClose (when the user clicks Dismiss, Close, Go to Concierge, or presses the backdrop/Escape).
      • In handleClose, if bulkAction still exists in Onyx and !bulkAction.shouldSendFromConcierge, call clearBulkAction(openBulkActionID, bulkAction); if the backend already deleted bulkAction (because shouldSendFromConcierge was true and Concierge sent the message), simply call setOpenBulkActionID(undefined).
    2. In src/components/BulkActionStatusModal.tsx:

      • Remove the early if (!bulkAction && !!displayedBulkAction) { return null; } guard (since displayedBulkAction = usePreviousDefined(bulkAction) already retains the last defined BulkAction state for display until onClose unmounts the modal).
      • Additionally, if we want the modal to stay on BulkActionDone once it transitions to DONE (or stay on BulkActionConcierge if shouldSendFromConcierge was clicked), keeping displayedBulkAction mounted until onClose ensures the modal never flashes and vanishes without user interaction.

    What alternative approaches did you explore? (Optional)

    If product prefers that clicking "Message me when it's done" keeps the modal on the "You bet!" (BulkActionConcierge) screen even if the job finishes before the user clicks Dismiss or Go to Concierge, we can also set const isConcierge = shouldSendFromConcierge; and guard BulkActionDone with !isConcierge && state === CONST.BULK_ACTION.STATE.DONE in BulkActionStatusModal.tsx, while still keeping the modal open until the user clicks Dismiss or Go to Concierge.

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.DailyKSv2EngineeringOverdue

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions