fix: wrong copy action when expense report is undefined#79748
fix: wrong copy action when expense report is undefined#79748mountiny merged 2 commits intoExpensify:mainfrom
Conversation
|
@thesahindia 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] |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fd6886236a
ℹ️ 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".
| if (isCopyAction) { | ||
| if (report) { | ||
| return computeReportName(report) || (originalReportAction?.childReportName ?? ''); | ||
| } | ||
| return originalReportAction?.childReportName ?? ''; |
There was a problem hiding this comment.
Fall back to message when report is missing
When isCopyAction is true and the report is missing (which the comment below notes can happen after sign‑in or before the report loads), this branch now returns originalReportAction?.childReportName ?? ''. Because childReportName is optional (and not set on some report preview actions), the copy operation can silently produce an empty string instead of the visible preview text; previously it would fall back to reportActionMessage via the empty‑report branch. This means users can get a blank clipboard entry in the missing‑report scenario. Consider falling back to reportActionMessage when childReportName is absent.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Can you please leave comments on the AI feedback? @truph01
There was a problem hiding this comment.
The ?? '' is just to address a type issue. As far as I know, there's no real scenario where originalReportAction?.childReportName would be undefined. So we don't need to consider a fallback value for reportActionMessage in cases where childReportName is absent.
Codecov Report❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.
|
|
@thesahindia can you review please? |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppScreen.Recording.2026-01-21.at.2.08.18.AM.movAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / SafariScreen.Recording.2026-01-21.at.1.13.17.AM.mov |
Thanks for the bump. |
| if (isCopyAction) { | ||
| if (report) { | ||
| return computeReportName(report) || (originalReportAction?.childReportName ?? ''); | ||
| } | ||
| return originalReportAction?.childReportName ?? ''; |
There was a problem hiding this comment.
Can you please leave comments on the AI feedback? @truph01
|
@truph01 bump |
|
@mountiny I just added a comment on AI feedback |
|
✋ 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/mountiny in version: 9.3.10-0 🚀
|
|
🚀 Deployed to production by https://github.com/roryabraham in version: 9.3.10-6 🚀
|
Explanation of Change
Fixed Issues
$ #77158
PROPOSAL:
Tests
Requirement: Have two accounts opened on two different devices or environments
User A has at least one workspace
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-01-16.at.14.03.50.mov
Android: mWeb Chrome
I encountered an error with this platform. I will update video later
iOS: Native
Screen.Recording.2026-01-16.at.14.06.06.mov
iOS: mWeb Safari
Screen.Recording.2026-01-16.at.14.03.07.mov
MacOS: Chrome / Safari
Screen.Recording.2026-01-16.at.14.01.04.mov