[HOLD for payment 2024-12-17] iOS - Expense - App returns to transaction thread when trying to replace receipt, then freezes
If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
Version Number: 9.0.73-6 Reproducible in staging?: Yes Reproducible in production?: No If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: Yes, reproducible on both If this was caught during regression testing, add the test name, ID and link from TestRail: Exp Email or phone of affected tester (no customers): [email protected] Issue reported by: Applause Internal Team
Action Performed:
- Launch ND or hybrid app.
- Go to workspace chat.
- Submit an expense with receipt.
- Go to transaction thread.
- Tap on the receipt.
- Tap 3-dot menu > Replace.
Expected Result:
Replace receipt page will open.
Actual Result:
App returns to transaction thread, then app freezes.
Workaround:
Unknown
Platforms:
- [ ] Android: Standalone
- [ ] Android: HybridApp
- [ ] Android: mWeb Chrome
- [x] iOS: Standalone
- [x] iOS: HybridApp
- [ ] iOS: mWeb Safari
- [ ] MacOS: Chrome / Safari
- [ ] MacOS: Desktop
Screenshots/Videos
https://github.com/user-attachments/assets/605059b6-dc9e-4026-9612-58de008894a8
Issue Owner
Current Issue Owner: @zanyrenney
Triggered auto assignment to @zanyrenney (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.
Triggered auto assignment to @youssef-lr (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.
💬 A slack conversation has been started in #expensify-open-source
:wave: Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
- Identify the pull request that introduced this issue and revert it.
- Find someone who can quickly fix the issue.
- Fix the issue yourself.
Can reproduce, pretty bad regression. Checking the deploy checklist for an offending PR.
Proposal
Please re-state the problem that we are trying to solve in this issue.
App returns to transaction thread, then app freezes.
What is the root cause of that problem?
It comes from https://github.com/Expensify/App/pull/53108. On IOS, we call onModalClose with a delay then we navigate to the scan page first then we call dismissModal here. That cause we go back to the TransactionReceiptPage and now the modal is hidden which is the freeze.
https://github.com/Expensify/App/blob/c8e8517e872c6a9dd739d2745ddd302058ac64de/src/components/AttachmentModal.tsx#L388
https://github.com/Expensify/App/blob/c8e8517e872c6a9dd739d2745ddd302058ac64de/src/libs/AttachmentModalHandler/index.ios.ts#L11-L15
What changes do you think we should make in order to solve the problem?
We should only call onModalClose with a delay when it's not receipt attachment
if (!isEmptyObject(report) && !isReceiptAttachment) {
attachmentModalHandler.handleModalClose(onModalClose);
} else {
onModalClose();
}
https://github.com/Expensify/App/blob/c8e8517e872c6a9dd739d2745ddd302058ac64de/src/components/AttachmentModal.tsx#L388
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
What alternative solutions did you explore? (Optional)
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
@Beamanator Can we add InteractionManager.runAfterInteractions for each onClose event instead of using it within AttachmentModal?
Mmmmm i mean yeah if that would be cleaner, that would work well! But using it within AttachmentModal like suggested above might make it so we don't have to remember to wrap onClose outside of AttachmentModal in the future, right?
@Beamanator Yes, you are correct
Confirmed this is fixed in staging
Reviewing label has been removed, please complete the "BugZero Checklist".
The solution for this issue has been :rocket: deployed to production :rocket: in version 9.0.73-8 and is now subject to a 7-day regression period :calendar:. Here is the list of pull requests that resolve this issue:
- https://github.com/Expensify/App/pull/53873
If no regressions arise, payment will be issued on 2024-12-17. :confetti_ball:
@youssef-lr @zanyrenney @youssef-lr The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]
The solution for this issue has been :rocket: deployed to production :rocket: in version 9.0.74-8 and is now subject to a 7-day regression period :calendar:. Here is the list of pull requests that resolve this issue:
- https://github.com/Expensify/App/pull/53873
If no regressions arise, payment will be issued on 2024-12-19. :confetti_ball:
@youssef-lr @zanyrenney @youssef-lr The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]
@youssef-lr is anyone due for payment here? I'm not really sure!
Skipping the payment summary for this issue since all the assignees are employees or vendors. If this is incorrect, please manually add the payment summary SO.
Closing, as this is only Yousef and me as assignees, payment is not due. Thank you for your hard work, @youssef-lr!