App icon indicating copy to clipboard operation
App copied to clipboard

[HOLD for payment 2024-12-17] iOS - Expense - App returns to transaction thread when trying to replace receipt, then freezes

Open IuliiaHerets opened this issue 1 year ago • 13 comments

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:

  1. Launch ND or hybrid app.
  2. Go to workspace chat.
  3. Submit an expense with receipt.
  4. Go to transaction thread.
  5. Tap on the receipt.
  6. 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

View all open jobs on GitHub

Issue OwnerCurrent Issue Owner: @zanyrenney

IuliiaHerets avatar Dec 10 '24 12:12 IuliiaHerets

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.

melvin-bot[bot] avatar Dec 10 '24 12:12 melvin-bot[bot]

Triggered auto assignment to @youssef-lr (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

melvin-bot[bot] avatar Dec 10 '24 12:12 melvin-bot[bot]

💬 A slack conversation has been started in #expensify-open-source

melvin-bot[bot] avatar Dec 10 '24 12:12 melvin-bot[bot]

: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:

  1. Identify the pull request that introduced this issue and revert it.
  2. Find someone who can quickly fix the issue.
  3. Fix the issue yourself.

github-actions[bot] avatar Dec 10 '24 12:12 github-actions[bot]

Can reproduce, pretty bad regression. Checking the deploy checklist for an offending PR.

youssef-lr avatar Dec 10 '24 14:12 youssef-lr

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.

mkzie2 avatar Dec 10 '24 15:12 mkzie2

@Beamanator Can we add InteractionManager.runAfterInteractions for each onClose event instead of using it within AttachmentModal?

huult avatar Dec 10 '24 16:12 huult

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 avatar Dec 10 '24 16:12 Beamanator

@Beamanator Yes, you are correct

huult avatar Dec 10 '24 16:12 huult

Confirmed this is fixed in staging

luacmartins avatar Dec 10 '24 19:12 luacmartins

Reviewing label has been removed, please complete the "BugZero Checklist".

melvin-bot[bot] avatar Dec 10 '24 22:12 melvin-bot[bot]

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:

melvin-bot[bot] avatar Dec 10 '24 22:12 melvin-bot[bot]

@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]

melvin-bot[bot] avatar Dec 10 '24 22:12 melvin-bot[bot]

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:

melvin-bot[bot] avatar Dec 12 '24 01:12 melvin-bot[bot]

@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]

melvin-bot[bot] avatar Dec 12 '24 01:12 melvin-bot[bot]

@youssef-lr is anyone due for payment here? I'm not really sure!

zanyrenney avatar Dec 16 '24 10:12 zanyrenney

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.

melvin-bot[bot] avatar Dec 19 '24 09:12 melvin-bot[bot]

Closing, as this is only Yousef and me as assignees, payment is not due. Thank you for your hard work, @youssef-lr!

zanyrenney avatar Dec 19 '24 17:12 zanyrenney