Add missing warning modals for re-exporting and retracting exported reports#82885
Add missing warning modals for re-exporting and retracting exported reports#82885
Conversation
…eports Set isExportedToIntegration optimistically in both exportToIntegration and markAsManuallyExported so the isExported check returns true immediately. Add isExported guard to the RETRACT action matching the existing REOPEN pattern. Co-authored-by: parasharrajat <parasharrajat@users.noreply.github.com>
|
I created this PR from an upstream branch since I don't have push access to your fork. To take ownership of this branch and be able to push updates, run: Then you can close this PR and open a new one from your fork. |
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.
|
|
@MelvinBot Merge main. |
…ctWarningModals Co-authored-by: parasharrajat <parasharrajat@users.noreply.github.com>
|
Merged main into this branch. No conflicts. |
…uration Co-authored-by: parasharrajat <parasharrajat@users.noreply.github.com>
|
Fixed the failing |
Screenshots🔲 iOS / native27.02.2026_01.19.47_REC.mp4🔲 iOS / Safari27.02.2026_01.21.06_REC.mp4🔲 MacOS / Chrome27.02.2026_01.02.46_REC.mp4 |
|
@MelvinBot Resolve conflicts and mark this PR ready for review. |
Main's refactored version already includes the isExportedToIntegration optimistic/failure data from this PR, with improvements (multi-report support, pendingFields, previousExportedValue revert). Co-authored-by: parasharrajat <parasharrajat@users.noreply.github.com>
|
@parasharrajat 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] |
|
Resolved merge conflicts and marked this PR as ready for review. Conflict details: The conflict was in The PR's other changes ( |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 34b2fc5b42
ℹ️ 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".
| value: { | ||
| isExportedToIntegration: false, | ||
| }, |
There was a problem hiding this comment.
Restore prior export state on export API failure
In exportToIntegration(), the failure path always writes isExportedToIntegration: false, which is incorrect when the user is re-exporting a report that was already exported. If the write fails (for example offline or transient network error), this clears the exported flag in Onyx even though the report is still exported, and ReportUtils.isExported() will trust that false value over action history, so follow-up safeguards (like re-export/reopen warnings) stop appearing until state is re-synced. Please preserve and restore the previous value (similar to markAsManuallyExported) instead of hard-coding false.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 638147a. Changed exportToIntegration() to capture previousExportedValue from Onyx before the optimistic update and restore it in failure data, matching the pattern already used in markAsManuallyExported().
Instead of hardcoding isExportedToIntegration: false in failure data, capture the previous value before the optimistic update and restore it on failure. This matches the pattern in markAsManuallyExported and prevents clearing the exported flag when re-exporting a report fails. Co-authored-by: parasharrajat <parasharrajat@users.noreply.github.com>
|
@codex review |
|
Codex Review: Didn't find any major issues. Already looking forward to the next diff. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
joekaufmanexpensify
left a comment
There was a problem hiding this comment.
Good for product
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / SafariMacOS: Desktop |
|
@lakchote wait. I am still confirming this with product team. I have tested and added vid as I think this is ready but I need to confirm copy before we merge. |
|
Merging (see #82745 (comment)) |
|
🚧 @lakchote 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! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/lakchote in version: 9.3.42-0 🚀
Bundle Size Analysis (Sentry): |
|
🚀 Deployed to production by https://github.com/grgia in version: 9.3.42-3 🚀
|
Explanation of Change
When a report has already been exported (via "Mark as exported" or "Export to integration"), two warning modals were not appearing:
"Careful!" re-export modal — The
markAsManuallyExportedandexportToIntegrationfunctions were not optimistically settingreport.isExportedToIntegration = true, so theisExportedcheck short-circuited tofalsebefore the server confirmed the export. This meant the re-export warning modal was never triggered."Reopen report" modal on Retract — The
RETRACTsecondary action handler calledretractReport()directly without checkingisExported, unlike the adjacentREOPENandUNAPPROVEhandlers which both show confirmation modals for exported reports.This PR fixes both issues by:
isExportedToIntegration: trueto bothexportToIntegrationandmarkAsManuallyExported(withfalsein failure data to revert on error)isExportedguard to theRETRACTaction handler, following the same pattern asREOPENFixed Issues
$ #82745
Tests
Precondition: Workspace connected to an accounting integration (e.g. Sage Intacct), Approvals and Payments disabled in Workflows.
Offline tests
QA Steps
Same as Tests above.
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
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari