fix: Unable to basic export expense when in group-by view#80969
fix: Unable to basic export expense when in group-by view#80969mjasikowski merged 5 commits intoExpensify:mainfrom
Conversation
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
@hoangzinh 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] |
src/pages/Search/SearchPage.tsx
Outdated
| query: status, | ||
| jsonQuery: JSON.stringify(queryJSON), | ||
| reportIDList: selectedReports?.map((report) => report?.reportID).filter((reportID) => reportID !== undefined) ?? [], | ||
| reportIDList: |
There was a problem hiding this comment.
❌ CONSISTENCY-3 (docs)
This code duplicates logic already computed in selectedReportIDs (lines 184-186) and selectedTransactionReportIDs (lines 174-183). Re-computing these values increases maintenance overhead and creates inconsistency.
Suggested fix:
reportIDList: selectedReports.length > 0 ? selectedReportIDs : selectedTransactionReportIDs,This reuses the already-computed, memoized values instead of duplicating the extraction logic.
Please rate this suggestion with 👍 or 👎 to help us improve! Reactions are used to monitor reviewer efficiency.
There was a problem hiding this comment.
It looks correct to me. Wdyt?
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 94ba1a21bf
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
src/pages/Search/SearchPage.tsx
Outdated
| : (Object.values(selectedTransactions ?? {}) | ||
| .map((transaction) => transaction?.reportID) | ||
| ?.filter((reportID) => reportID !== undefined) ?? []), |
There was a problem hiding this comment.
Add selectedTransactions to basic export callback deps
This new fallback reads selectedTransactions to build reportIDList, but handleBasicExport’s useCallback dependency array was not updated to include selectedTransactions. In grouped views, selection metadata can be refreshed while the selected key set stays the same (so selectedTransactionsKeys does not change), which leaves this callback closing over stale transaction objects and can send outdated or empty reportIDList values to exportSearchItemsToCSV.
Useful? React with 👍 / 👎.
|
@truph01 I have a feedback here #80969 (comment) |
JmillsExpensify
left a comment
There was a problem hiding this comment.
Part of an existing product initiative.
How is it going? @truph01 |
|
@hoangzinh I just applied your suggestion. |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppScreen.Recording.2026-02-18.at.08.10.12.movAndroid: mWeb ChromeScreen.Recording.2026-02-18.at.08.07.58.moviOS: HybridAppScreen.Recording.2026-02-18.at.08.11.52.moviOS: mWeb SafariScreen.Recording.2026-02-18.at.08.13.29.movMacOS: Chrome / SafariScreen.Recording.2026-02-18.at.08.04.57.mov |
|
🚧 @mjasikowski has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/mjasikowski in version: 9.3.22-0 🚀
|
|
🚀 Deployed to production by https://github.com/mountiny in version: 9.3.22-4 🚀
|
|
🚀 Deployed to production by https://github.com/mountiny in version: 9.3.22-4 🚀
|
Explanation of Change
reportIDListsent to the backend via theExportSearchToCSVAPI is always empty. This PR ensures that the correctreportIDListdata is sent to the backend.Fixed Issues
$ #79194
PROPOSAL: #79194 (comment)
Tests
Offline tests
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Screen.Recording.2026-02-10.at.15.02.03.mov
Android: mWeb Chrome
Screen.Recording.2026-02-10.at.14.55.30.mov
iOS: Native
Screen.Recording.2026-02-10.at.14.57.07.mov
iOS: mWeb Safari
Screen.Recording.2026-02-10.at.14.53.22.mov
MacOS: Chrome / Safari
Screen.Recording.2026-02-10.at.14.49.40.mov