Skip to content

Fix clearSelectedTransactions call in export download status modal - #95469

Merged
mollfpr merged 5 commits into
Expensify:mainfrom
lorretheboy:fix/94717
Jul 10, 2026
Merged

mollfpr merged 5 commits into
Expensify:mainfrom
lorretheboy:fix/94717

Conversation

@lorretheboy

@lorretheboy lorretheboy commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Explanation of Change

The report‑level export status modal runs a cleanup callback on dismiss, but that callback calls clearSelectedTransactions with the wrong argument shape, so the report‑view selection is never reset. This PR is for correcting those callback calls

Fixed Issues

$ #94717
PROPOSAL: #94717 (comment)

Tests

  1. Launch Expensify app.
  2. Log in with valid credentials.
  3. Navigate to an expense report that contains more than one expense.
  4. Enter selection mode.
  5. Select one or more transactions.
  6. Open the selection dropdown.
  7. Navigate to Export > All Data - expense level.
  8. Wait for the export flow to complete (Preparing → Ready).
  9. Dismiss the export status modal.
  10. Verify that The selected transactions should be cleared after the export status modal is dismissed.
  • Verify that no errors appear in the JS console

Offline tests

QA Steps

  1. Launch Expensify app.
  2. Log in with valid credentials.
  3. Navigate to an expense report that contains more than one expense.
  4. Enter selection mode.
  5. Select one or more transactions.
  6. Open the selection dropdown.
  7. Navigate to Export > All Data - expense level.
  8. Wait for the export flow to complete (Preparing → Ready).
  9. Dismiss the export status modal.
  10. Verify that The selected transactions should be cleared after the export status modal is dismissed.
  • Verify that no errors appear in the JS console

PR Author Checklist

  • I linked the correct issue in the ### Fixed Issues section above
  • I wrote clear testing steps that cover the changes made in this PR
    • I added steps for local testing in the Tests section
    • I added steps for the expected offline behavior in the Offline steps section
    • I added steps for Staging and/or Production testing in the QA steps section
    • I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
    • I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).
  • I included screenshots or videos for tests on all platforms
  • I ran the tests on all platforms & verified they passed on:
    • Android: Native
    • Android: mWeb Chrome
    • iOS: Native
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
  • I followed proper code patterns (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick)
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I followed the guidelines as stated in the Review Guidelines
  • I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)
  • If any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))
  • If new assets were added or existing ones were modified, I verified that:
    • The assets are optimized and compressed (for SVG files, run npm run compress-svg)
    • The assets load correctly across all supported platforms.
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • I added unit tests for any new feature or bug fix in this PR to help automatically prevent regressions in this user flow.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.

Screenshots/Videos

Android: Native
Screen.Recording.2026-07-07.at.02.00.25.mov
Android: mWeb Chrome
Screen.Recording.2026-07-07.at.02.01.46.mov
iOS: Native
Screen.Recording.2026-07-07.at.01.56.30.mov
iOS: mWeb Safari
Screen.Recording.2026-07-07.at.01.53.38.mov
MacOS: Chrome / Safari
Screen.Recording.2026-07-07.at.01.52.19.mov

@lorretheboy
lorretheboy marked this pull request as ready for review July 7, 2026 07:02
@lorretheboy
lorretheboy requested review from a team as code owners July 7, 2026 07:02
@melvin-bot
melvin-bot Bot requested review from marufsharifi and trjExpensify and removed request for a team July 7, 2026 07:02
@melvin-bot

melvin-bot Bot commented Jul 7, 2026

Copy link
Copy Markdown

@marufsharifi Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button]

@marufsharifi

Copy link
Copy Markdown
Contributor

@lorretheboy, could you please fill out the Explanation of Change as well?

@lorretheboy

Copy link
Copy Markdown
Contributor Author

@marufsharifi I added the explanation

@marufsharifi

Copy link
Copy Markdown
Contributor

@lorretheboy, this fixes the report-level export modal cleanup by changing both call sites from clearSelectedTransactions(undefined, true) to clearSelectedTransactions(true), but there’s no test covering that exact bug. Since the selection API branches on boolean arguments, the previous call shape still compiled while clearing the wrong selection state. Could we add a focused unit/component test that mocks useExportDownloadStatusModal, captures the cleanup callback from SelectionToolbar and/or useExportActions, invokes it, and asserts clearSelectedTransactions is called with true? This should fail before the fix and pass after.

trjExpensify
trjExpensify previously approved these changes Jul 7, 2026

@trjExpensify trjExpensify left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can see we do this for other actions like Hold, so makes sense to follow suit. 👍

@marufsharifi

Copy link
Copy Markdown
Contributor

@lorretheboy, could you please check the above comment?

@marufsharifi

Copy link
Copy Markdown
Contributor

@lorretheboy, do you need any help?

@lorretheboy

Copy link
Copy Markdown
Contributor Author

@marufsharifi I'm taking a look on it now. Will let u know if having any issues

@lorretheboy

Copy link
Copy Markdown
Contributor Author

@marufsharifi I added UT

@marufsharifi

Copy link
Copy Markdown
Contributor

@MelvinBot, can you give me the manual test steps for the changes in this PR?

@MelvinBot

Copy link
Copy Markdown
Contributor

Here are manual test steps that exercise both call sites this PR touches. The fix wires clearSelectedTransactions(true) into the export-download-status-modal's dismiss callback so the report-view selection is actually cleared, so each path is verified by confirming the selection resets after the modal is dismissed.

Setup

  1. Open an expense report that contains more than one expense (so bulk selection is possible), on a workspace where you can export report data.

Path 1 — Bulk-selection toolbar (SelectionToolbar)

  1. Enter selection mode on the report and select one or more transactions (the selection toolbar appears).
  2. From the selection toolbar's export/download option, trigger Export → Download (CSV/all-data expense level).
  3. Wait for the export status modal to progress from Preparing → Ready.
  4. Dismiss (close) the export status modal.
  5. Verify: the previously selected transactions are now deselected and selection mode resets (no lingering checkmarks / selection count).

Path 2 — Report header Export action (useExportActions)

  1. Back on the report, use the report header's Export / download action (the header dropdown or secondary-actions "Export"), and again select transactions where applicable, then trigger a Download export.
  2. Wait for the export status modal to reach Ready, then dismiss it.
  3. Verify: the report-view selection is cleared after dismissing the modal.

General

  1. Verify: no errors appear in the JS console during either flow.

Regression check: confirm that before this fix the selection stayed highlighted after dismissing the modal, and with this fix it clears — that's the exact behavior the added unit test asserts (clearSelectedTransactions is called with the boolean true).

Note: these mirror the PR's existing Tests/QA steps but add explicit coverage for the second changed call site (the report-header Export action in useExportActions.ts), not just the selection toolbar.

@marufsharifi

Copy link
Copy Markdown
Contributor

@lorretheboy, could you please merge the main? thanks.

@lorretheboy

Copy link
Copy Markdown
Contributor Author

@marufsharifi I merged main

@marufsharifi

Copy link
Copy Markdown
Contributor

@lorretheboy, could you please check the failed action? thanks.

@lorretheboy

Copy link
Copy Markdown
Contributor Author

@marufsharifi I think it doesn't related to our PR

image

@lorretheboy

lorretheboy commented Jul 10, 2026

Copy link
Copy Markdown
Contributor Author

Lemme try to re-run the workflow

@melvin-bot
melvin-bot Bot requested a review from mollfpr July 10, 2026 09:41
@marufsharifi

marufsharifi commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Reviewer Checklist

  • I have verified the author checklist is complete (all boxes are checked off).
  • I verified the correct issue is linked in the ### Fixed Issues section above
  • I verified testing steps are clear and they cover the changes made in this PR
    • I verified the steps for local testing are in the Tests section
    • I verified the steps for Staging and/or Production testing are in the QA steps section
    • I verified the steps cover any possible failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
  • I checked that screenshots or videos are included for tests on all platforms
  • I included screenshots or videos for tests on all platforms
  • I verified that the composer does not automatically focus or open the keyboard on mobile unless explicitly intended. This includes checking that returning the app from the background does not unexpectedly open the keyboard.
  • I verified tests pass on all platforms & I tested again on:
    • Android: HybridApp
    • Android: mWeb Chrome
    • iOS: HybridApp
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • If there are any errors in the console that are unrelated to this PR, I either fixed them (preferred) or linked to where I reported them in Slack
  • I verified proper code patterns were followed (see Reviewing the code)
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I verified that this PR follows the guidelines as stated in the Review Guidelines
  • I verified other components that can be impacted by these changes have been tested, and I retested again (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar have been tested & I retested again)
  • If a new component is created I verified that:
    • A similar component doesn't exist in the codebase
    • All props are defined accurately
    • The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
    • The only data being stored in the state is data necessary for rendering and nothing else
    • The component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • For any bug fix or new feature in this PR, I verified that sufficient unit tests are included to prevent regressions in this flow.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.
  • I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.

Screenshots/Videos

Android: HybridApp
Screen.Recording.2026-07-10.at.3.44.04.PM.mov
Android: mWeb Chrome
Screen_Recording_20260710_142918_Chrome.mp4
iOS: HybridApp
Screen.Recording.1405-04-19.at.5.32.52.PM.mov
iOS: mWeb Safari
Screen.Recording.1405-04-19.at.5.00.21.PM.mov
MacOS: Chrome / Safari
Screen.Recording.2026-07-10.at.2.22.53.PM.mov

@marufsharifi

Copy link
Copy Markdown
Contributor

@mollfpr, the PR reviewer checklist should pass once you rerun the actions. This is done from my side; all yours.

@mollfpr
mollfpr merged commit 846ccd5 into Expensify:main Jul 10, 2026
35 of 36 checks passed
@OSBotify

Copy link
Copy Markdown
Contributor

✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

@github-actions

Copy link
Copy Markdown
Contributor

🚧 mollfpr has triggered a test Expensify/App build. You can view the workflow run here.

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to staging by https://github.com/mollfpr in version: 9.4.34-0 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

@MelvinBot

Copy link
Copy Markdown
Contributor

🤖 Help site review: no docs changes required

I reviewed the changes in this PR and confirmed no updates are needed to Expensify's help site files under App/docs/articles, so I did not create a draft PR.

Why: This is a purely internal bug fix. It corrects the argument shape passed to the selection cleanup callback — clearSelectedTransactions(undefined, true)clearSelectedTransactions(true) — so the report-view selection is actually reset when the export status modal is dismissed. It restores already-intended behavior and does not add or change any user-facing feature, tab, setting, label, or workflow that the help site documents.

What I checked
  • Diff scope: src/components/MoneyRequestReportView/SelectionToolbar/index.tsx, src/hooks/useExportActions.ts, and a unit test in tests/unit/hooks/useExportActionsTest.ts — all internal code, no copy/UI additions.
  • Searched App/docs/articles for content describing the selection-mode / export-download-status-modal behavior. The only matches (duplicating expenses, Sage Intacct/QuickBooks export sync errors) are unrelated to this fix. No article documents the "selection clears after dismissing the export status modal" behavior, so there is nothing to update.

Note: browser-based verification of the live UI was unavailable in this run (web prep failed), so this assessment is based on static analysis of the code and help-site content only.

@lorretheboy — since no help site changes were required, there is no linked help site PR to review here. If you believe this change does affect documented behavior, let me know and I'll create the draft PR.

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/roryabraham in version: 9.4.34-14 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 failure ❌
🍎 iOS 🍎 failure ❌

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/roryabraham in version: 9.4.34-14 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

Bundle Size Analysis (Sentry):

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants