Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[HOLD for payment 2024-09-10] [$250] iOS - Scan - Unable to delete receipt #46852

Closed
1 of 6 tasks
mvtglobally opened this issue Aug 6, 2024 · 31 comments
Closed
1 of 6 tasks
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Weekly KSv2

Comments

@mvtglobally
Copy link

mvtglobally commented Aug 6, 2024

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: v9.0.16-5
Reproducible in staging?: Y
Reproducible in production?:
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):[email protected]
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: Applause- Internal team
Slack conversation:

Action Performed:

  1. Launch New Expensify app.
  2. Go to workspace chat.
  3. Submit an expense with a receipt.
  4. Go to transaction thread.
  5. Tap on the receipt.
  6. Tap 3-dot menu.
  7. Tap Delete receipt.

Expected Result:

Delete receipt modal will appear.

Actual Result:

Delete receipt modal does not appear. Unable to delete receipt.

Workaround:

unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence

Bug6562931_1722908349762.ScreenRecording_08-06-2024_09-28-34_1.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01d0e9a861da3dc3f7
  • Upwork Job ID: 1823033534353897628
  • Last Price Increase: 2024-08-12
@mvtglobally mvtglobally added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Aug 6, 2024
Copy link

melvin-bot bot commented Aug 6, 2024

Triggered auto assignment to @greg-schroeder (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.

@mvtglobally
Copy link
Author

We this this might be related to #wave-control

@bernhardoj
Copy link
Contributor

Proposal

Please re-state the problem that we are trying to solve in this issue.

Can't delete receipt because the delete confirmation modal doesn't show.

What is the root cause of that problem?

This happens after #45762 where we call the onSelected callback of popover immediately. The onSelected of the delete receipt option will show another modal and without waiting for the previous modal to hide (which we did before the PR), the second modal won't show.

if (TransactionUtils.hasReceipt(transaction) && !TransactionUtils.isReceiptBeingScanned(transaction) && canEditReceipt && !TransactionUtils.hasMissingSmartscanFields(transaction)) {
menuItems.push({
icon: Expensicons.Trashcan,
text: translate('receipt.deleteReceipt'),
onSelected: () => {
setIsDeleteReceiptConfirmModalVisible(true);
},
});
}

What changes do you think we should make in order to solve the problem?

We have been fixing this issue by using Modal.close to wait for the modal to completely close, however, in our case, calling Modal.close will close the transaction receipt modal too. Instead of using Modal.close one by one, I propose to take a different approach to fix #45417.

Before the PR, the popover item onSelected is called when the modal is completely closed and this will stay as the default behavior. To fix #45417, we can have a new prop for the menu items to tell whether we want to wait for the modal to hide or not, we can call it selectOnModalHide.

Here is the detail:

  1. Revert fix(PopoverMenu): fix opening external links #45762 and any changes that add Modal.close to fix the regression that comes after the PR.
  2. In selectItem, if selectOnModalHide is false, then call onSelected immediately, otherwise, call it when the modal hides.
    } else {
    onItemSelected(selectedItem, index);
    selectedItem.onSelected?.();
    }
if (selectedItem.selectOnModalHide !== false) {
    selectedItemIndex.current = index;
} else {
    selectedItem.onSelected?.();
}
  1. Then, we can pass selectOnModalHide as false to any popover menu that we want to select the item immediately.
    Usage example:
menuItems.push({
    icon: Expensicons.Link,
    text: 'Open Link',
    selectOnModalHide: false,
    onSelected: () => {
        Link.openLink(getQuickBooksOnlineSetupLink('DF6835925B6E1C85'), CONST.NEW_EXPENSIFY_URL);
    },
});

@arosiclair
Copy link
Contributor

arosiclair commented Aug 6, 2024

@zfurtak can you take a look at this? It looks like it's caused by our changes in #45762

@zfurtak
Copy link
Contributor

zfurtak commented Aug 7, 2024

hello 😊
Yesterday I was looking into this case, but haven't found a suitable solution yet, as this exact screen has crazy re-render logic with 3 modals at the same moment. Still thinking... 🤔
I'm not a big fan of reverting changes, as the previous solution was a bit of a workaround. However it might be a good idea to add a flag with a default value and only change it where it's needed. This will make it easier for contributors to work with PopoverMenu in the future.
I will continue my investigation today 👍

@melvin-bot melvin-bot bot added the Overdue label Aug 8, 2024
Copy link

melvin-bot bot commented Aug 9, 2024

@greg-schroeder Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@greg-schroeder
Copy link
Contributor

@zfurtak @arosiclair do you guys think this should be sent to External or will it be taken care of as a sort of regression?

@arosiclair
Copy link
Contributor

Yeah this is external. Assigning @zfurtak

@arosiclair arosiclair added the External Added to denote the issue can be worked on by a contributor label Aug 12, 2024
@melvin-bot melvin-bot bot changed the title iOS - Scan - Unable to delete receipt [$250] iOS - Scan - Unable to delete receipt Aug 12, 2024
Copy link

melvin-bot bot commented Aug 12, 2024

Job added to Upwork: https://www.upwork.com/jobs/~01d0e9a861da3dc3f7

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Aug 12, 2024
@arosiclair arosiclair self-assigned this Aug 12, 2024
Copy link

melvin-bot bot commented Aug 12, 2024

Triggered auto assignment to Contributor-plus team member for initial proposal review - @fedirjh (External)

@arosiclair arosiclair assigned zfurtak and unassigned fedirjh Aug 12, 2024
@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Aug 12, 2024
@zfurtak
Copy link
Contributor

zfurtak commented Aug 13, 2024

hello 😊
I managed to find a solution for this problem without reverting previous changes and in the same time being easier to maintain in the future 🚀

My idea is to add flag to every item that needs calling after the modal is hidden and for this specific case (deleting receipt) I had to changed code in Modal component as the logic was adjusted to a fix from the future and was causing a problem here.
I created a PR, which is yet in draft as I need one internal review to push it further 🤓

@arosiclair
Copy link
Contributor

@fedirjh @arosiclair Could you mark #47341 as ready for review? 🙏 I'm going to take this over from @zfurtak because she is OOO but I'm not the author and can't mark it 😓

Done

Copy link

melvin-bot bot commented Aug 19, 2024

@arosiclair, @greg-schroeder, @fedirjh, @zfurtak Whoops! This issue is 2 days overdue. Let's get this updated quick!

@fedirjh
Copy link
Contributor

fedirjh commented Aug 20, 2024

PR in review.

@melvin-bot melvin-bot bot removed the Overdue label Aug 20, 2024
Copy link

melvin-bot bot commented Aug 20, 2024

@arosiclair @greg-schroeder @fedirjh @zfurtak this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

@arosiclair
Copy link
Contributor

In review

@arosiclair arosiclair added the Reviewing Has a PR in review label Aug 20, 2024
Copy link

melvin-bot bot commented Aug 22, 2024

⚠️ Looks like this issue was linked to a Deploy Blocker here

If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

If a regression has occurred and you are the assigned CM follow the instructions here.

If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

Copy link

melvin-bot bot commented Aug 23, 2024

⚠️ Looks like this issue was linked to a Deploy Blocker here

If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

If a regression has occurred and you are the assigned CM follow the instructions here.

If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Daily KSv2 labels Aug 26, 2024
@greg-schroeder
Copy link
Contributor

Just tracking for record keeping purposes - original PR was reverted.

New PR is in review

Copy link

melvin-bot bot commented Aug 30, 2024

⚠️ Looks like this issue was linked to a Deploy Blocker here

If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

If a regression has occurred and you are the assigned CM follow the instructions here.

If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

Copy link

melvin-bot bot commented Sep 3, 2024

⚠️ Looks like this issue was linked to a Deploy Blocker here

If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

If a regression has occurred and you are the assigned CM follow the instructions here.

If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

@zfurtak
Copy link
Contributor

zfurtak commented Sep 4, 2024

The issue is fixed by this PR.

@greg-schroeder
Copy link
Contributor

Thanks @zfurtak

@greg-schroeder
Copy link
Contributor

Regression period 2024-09-10

@greg-schroeder greg-schroeder added Awaiting Payment Auto-added when associated PR is deployed to production and removed Reviewing Has a PR in review labels Sep 9, 2024
@melvin-bot melvin-bot bot added the Overdue label Sep 9, 2024
@greg-schroeder greg-schroeder changed the title [$250] iOS - Scan - Unable to delete receipt [HOLD for payment 2024-09-10] [$250] iOS - Scan - Unable to delete receipt Sep 9, 2024
@greg-schroeder
Copy link
Contributor

Will prep this for Tuesday

@melvin-bot melvin-bot bot removed the Overdue label Sep 9, 2024
Copy link

melvin-bot bot commented Sep 10, 2024

Payment Summary

Upwork Job

  • Reviewer: @fedirjh owed $125 via NewDot
  • Contributor: @zfurtak is from an agency-contributor and not due payment

BugZero Checklist (@greg-schroeder)

  • I have verified the correct assignees and roles are listed above and updated the neccesary manual offers
  • I have verified that there are no duplicate or incorrect contracts on Upwork for this job (https://www.upwork.com/ab/applicants/1823033534353897628/hired)
  • I have paid out the Upwork contracts or cancelled the ones that are incorrect
  • I have verified the payment summary above is correct

@greg-schroeder
Copy link
Contributor

@fedirjh I believe you're paid via NewDot now, right? If so, you can make a manual request for $125 for the C+ role. $250 original price x 50% given the regression/revert.

@garrettmknight
Copy link
Contributor

$125 approved for @fedirjh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Weekly KSv2
Projects
No open projects
Status: Done
Development

No branches or pull requests

8 participants