Pass report to isExported/hasExportError to fix primary action after failed export#90154
Conversation
After a failed QBO export, the primary action button incorrectly shows Pay instead of Export. Two utility calls in ReportPrimaryActionUtils were missing the report parameter, causing them to fall back to action-based scanning which returns stale results after export failure. Also fix the same missing parameter in ReportDetailsExportPage. Co-authored-by: Krishna <Krishna2323@users.noreply.github.com>
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
@MelvinBot merge main and complete the checklist |
…ryActionAfterFail Co-authored-by: Krishna <Krishna2323@users.noreply.github.com>
|
Merged main and completed the PR Author Checklist (checked off all N/A items — no new files, CSS, assets, UI changes, deeplinks, storybook, generic components, or message editing code). Left the testing steps, screenshots, and platform test items unchecked for the human co-author to fill out. |
|
@MelvinBot add the testing steps as well and check off screenshots also, I'll be adding those in reviewer checklist so we don't need it in author checklist. |
|
Updated the PR body:
|
|
@MelvinBot mark this PR ready for review |
|
Marked this PR as ready for review. |
|
@Krishna2323 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] |
|
@madmax330 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] |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppandroid_hybrid.mp4Android: mWeb Chromeandroid_mWeb.mp4iOS: HybridAppios_hybrid.mp4iOS: mWeb Safariios_mWeb.mp4MacOS: Chrome / Safariweb_chrome.mp4 |
|
@madmax330 looks like this was merged without a test passing. Please add a note explaining why this was done and remove the |
|
🚧 @madmax330 has triggered a test Expensify/App build. You can view the workflow run here. |
|
Tests were passing |
|
🧪🧪 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/madmax330 in version: 9.3.78-0 🚀
Bundle Size Analysis (Sentry): |
|
No help site changes required. This PR is a bug fix that passes a missing |
|
Deploy Blocker #91153 was identified to be related to this PR. |
|
🚀 Deployed to production by https://github.com/roryabraham in version: 9.3.78-1 🚀
|
Explanation of Change
Two utility calls in
ReportPrimaryActionUtils.tswere missing thereportparameter, causing them to fall back to scanning report actions instead of reading the authoritative report flags. After a failed QBO export:isPrimaryPayActioncalledisExportedUtil(reportActions)withoutreport— the stale optimisticEXPORTED_TO_INTEGRATIONaction made it returnisExported = true, hiding the export failure and incorrectly showing the Pay button.isExportActioncalledhasExportErrorUtil(reportActions)withoutreport— even if control reached this function, the action-based fallback could miss the error, preventing the Export button from appearing.Both fixes pass
reportto align with how other callers (e.g.,ReportPreviewActionUtils) already use these utilities. Also fixes the same missingreportparameter inReportDetailsExportPage.tsxas requested in the issue review.Fixed Issues
$ #87654
PROPOSAL: #87654 (comment)
Tests
Offline tests
N/A — this change only affects which primary action button is displayed; no network behavior is altered.
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand 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
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
AI Tests
Ran:
npm run typecheck-tsgo— passed (pre-existing errors in unrelatedConvertGpsPointsTo2DArray.tsonly)npm run lint-changed— passed (no lintable files changed)npx prettier --write— passed (no formatting changes needed)npm test -- --silent— 13,426 passed, 7 failed (all failures increateOrUpdateDeployChecklistTest.ts, pre-existing and unrelated)npm run react-compiler-compliance-check check-changed— could not run (environment lacks upstream branch config)