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 2023-10-25] [$500] IOU - Request money is not successful after refreshing in confirm page #28347

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

Comments

@lanitochka17
Copy link

lanitochka17 commented Sep 27, 2023

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Action Performed:

  1. Go to any report
  2. Click on + button and request money
  3. Upload an image for receipt
  4. Refresh the page
  5. Press the request button

Expected Result:

Money should be requested and it should show scanning

Actual Result:

Nothing happens

Workaround:

Unknown

Platforms:

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

  • Android / native
  • Android / Chrome
  • iOS / native
  • iOS / Safari
  • MacOS / Chrome / Safari
  • MacOS / Desktop

Version Number: 1.3.74-2

Reproducible in staging?: Yes

Reproducible in production?: Yes

If this was caught during regression testing, add the test name, ID and link from TestRail:

Email or phone of affected tester (no customers):

Logs: https://stackoverflow.com/c/expensify/questions/4856

Notes/Photos/Videos: Any additional supporting documentation

Screen.Recording.2023-09-27.at.14.36.23.mov
bandicam.2023-09-28.00-54-33-234.mp4

Expensify/Expensify Issue URL:

Issue reported by: @alitoshmatov

Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1694717028781839

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~011e5061c23f7df911
  • Upwork Job ID: 1707121850103009280
  • Last Price Increase: 2023-09-27
  • Automatic offers:
    • mollfpr | Reviewer | 27022006
    • DylanDylann | Contributor | 27022008
    • alitoshmatov | Reporter | 27022010
@lanitochka17 lanitochka17 added External Added to denote the issue can be worked on by a contributor Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Sep 27, 2023
@DylanDylann
Copy link
Contributor

Proposal

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

Request money is not successful after refreshing in confirm page

What is the root cause of that problem?

const filePath = URL.createObjectURL(file);

In the web, we are creating a new Object URL to save the file. But when we reload the page that object URL is removed (reference for this point: https://stackoverflow.com/questions/13966186/how-long-does-a-blob-persist)

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

Let's see another place where we also use a new Object URL to save the file

Screen.Recording.2023-09-15.at.17.43.22.mov

In adding an attachment, when reloading we hide the selected attachment modal. So, I suggest that we check if the url Object is removed, we will redirect to ReceiptSelector page. To do that, in here

Add this code to check objectURL is valid or not

if (props.iou.receiptPath && props.iou.receiptSource) {
            FileUtils.readFileAsync(props.iou.receiptPath, props.iou.receiptSource).then((receipt) => {
                if (!receipt) {
                    const fallback = ROUTES.getMoneyRequestRoute(iouType.current, reportID.current);
                    Navigation.goBack(fallback);
                } else {
                    setReceiptState(receipt)
                }
            });
        }

And then in here

if (props.iou.receiptPath && props.iou.receiptSource) {

we only need to check receiptState and request money

if (receiptState) {
                requestMoney(selectedParticipants, trimmedComment, receiptState);
                return;
            }

What alternative solutions did you explore? (Optional)

We can save uploaded files to localStorage

@melvin-bot melvin-bot bot changed the title IOU - Request money is not successful after refreshing in confirm page [$500] IOU - Request money is not successful after refreshing in confirm page Sep 27, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 27, 2023

Triggered auto assignment to @johncschuster (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

@melvin-bot
Copy link

melvin-bot bot commented Sep 27, 2023

Job added to Upwork: https://www.upwork.com/jobs/~011e5061c23f7df911

@melvin-bot
Copy link

melvin-bot bot commented Sep 27, 2023

Bug0 Triage Checklist (Main S/O)

  • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
  • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
    • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
  • This bug is reproducible using the reproduction steps in the OP. S/O
    • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
    • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
  • This issue is filled out as thoroughly and clearly as possible
    • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
  • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Sep 27, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 27, 2023

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

@mollfpr
Copy link
Contributor

mollfpr commented Sep 28, 2023

@DylanDylann Does your alternative solution use Onyx to save the URL object? The better fix should make the submit still processable.

@DylanDylann
Copy link
Contributor

@mollfpr I can't reproduce this bug when reloading the App redirects to the initial page. Do you want to fix as suggestion here

The better fix should make the submit still processable.

@mollfpr
Copy link
Contributor

mollfpr commented Sep 29, 2023

In adding an attachment, when reloading we hide the selected attachment modal. So, I suggest that we check if the url Object is removed, we will redirect to ReceiptSelector page.

@DylanDylann The expected result should keep the user on the same page after reloading and the submit request is successful. From your RCA the issue is because the object URL is removed after reloading, so I'm thinking your alternative solution is to keep the object URL and set it back.

@DylanDylann
Copy link
Contributor

We need to wait for this reverted PR #28410 to be merged. So we can move forward this bug

@melvin-bot melvin-bot bot added the Overdue label Oct 2, 2023
@mollfpr
Copy link
Contributor

mollfpr commented Oct 2, 2023

@DylanDylann Where's the revert issue?

@melvin-bot melvin-bot bot removed the Overdue label Oct 2, 2023
@DylanDylann
Copy link
Contributor

@mollfpr We had a blocker that blocked this issue on the main yesterday. But now It is resolved. Please ignore the above comment

@DylanDylann
Copy link
Contributor

@mollfpr

The expected result should keep the user on the same page after reloading and the submit request is successful.

To do that, I have 2 suggestions:

  1. Created new API to update receipt image to server when user uploading image
  2. Using FileSystem API you'll need to request PERSISTENT storage, and the user will have to agree to let you store data on their machine permanently.

I understand the benefit from your viewpoint But both ways are complicated. I see It's a bit overkill for this issue. Note that

  1. when the user uploads the receipt image and close modal we also remove the uploaded image
  2. When the user uploads attachment then reloading, this attachment also be removed

Anyways, Let's confirm the expected before moving forward.

@shawnborton Please help to give some thought from UX perspective on this issue.

@shawnborton
Copy link
Contributor

Hmm I am a bit confused here about this one. @alitoshmatov since you reported this one, can you walk me through when exactly you think a user would experience this? I am having a hard time understanding why a user would refresh the app after they upload a receipt.

@DylanDylann
Copy link
Contributor

@mollfpr Could you check this comment?

#28320 (comment)

@luacmartins luacmartins self-assigned this Oct 3, 2023
@mollfpr
Copy link
Contributor

mollfpr commented Oct 4, 2023

Thanks @DylanDylann. It seems reasonable to redirect the user back.

@luacmartins I think you already agree with the expected result, and the proposal looks good!

🎀 👀 🎀 C+ reviewed!

@melvin-bot
Copy link

melvin-bot bot commented Oct 4, 2023

Current assignee @luacmartins is eligible for the choreEngineerContributorManagement assigner, not assigning anyone new.

@aimane-chnaif
Copy link
Contributor

This might need to put on hold for #26538

@luacmartins
Copy link
Contributor

Thanks for the link @aimane-chnaif. We'll refactor navigation for multi-step flows, but I still think the changes to readFileAsync mentioned in this proposal are good and shouldn't overlap with that refactor, so I think we can move on with this issue.

@melvin-bot melvin-bot bot added the Weekly KSv2 label Oct 5, 2023
@DylanDylann
Copy link
Contributor

@mollfpr The PR is ready for review

@melvin-bot
Copy link

melvin-bot bot commented Oct 17, 2023

Based on my calculations, the pull request did not get merged within 3 working days of assignment. Please, check out my computations here:

  • when @DylanDylann got assigned: 2023-10-04 16:25:40 Z
  • when the PR got merged: 2023-10-17 17:37:40 UTC
  • days elapsed: 9

On to the next one 🚀

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Oct 18, 2023
@melvin-bot melvin-bot bot changed the title [$500] IOU - Request money is not successful after refreshing in confirm page [HOLD for payment 2023-10-25] [$500] IOU - Request money is not successful after refreshing in confirm page Oct 18, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 18, 2023

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

@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Oct 18, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 18, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.86-5 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2023-10-25. 🎊

After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.

  • External issue reporter
  • Contributor that fixed the issue
  • Contributor+ that helped on the issue and/or PR

For reference, here are some details about the assignees on this issue:

As a reminder, here are the bonuses/penalties that should be applied for any External issue:

  • Merged PR within 3 business days of assignment - 50% bonus
  • Merged PR more than 9 business days after assignment - 50% penalty

@melvin-bot
Copy link

melvin-bot bot commented Oct 18, 2023

BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

  • [@luacmartins] The PR that introduced the bug has been identified. Link to the PR:
  • [@luacmartins] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:
  • [@luacmartins] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:
  • [@mollfpr / @DylanDylann] Determine if we should create a regression test for this bug.
  • [@mollfpr / @DylanDylann] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
  • [@johncschuster] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@johncschuster johncschuster added the Daily KSv2 label Oct 20, 2023
@johncschuster
Copy link
Contributor

Waiting to issue payment on 2023-10-25

@johncschuster johncschuster removed the Daily KSv2 label Oct 20, 2023
@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Oct 25, 2023
@mollfpr
Copy link
Contributor

mollfpr commented Oct 25, 2023

[@luacmartins] The PR that introduced the bug has been identified. Link to the PR:

#23770

[@luacmartins] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:

https://github.com/Expensify/App/pull/23770/files#r1371795681

[@luacmartins] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:

The regression step should be enough.

[@mollfpr / @DylanDylann] Determine if we should create a regression test for this bug.
[@mollfpr / @DylanDylann] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.

Only testable in Web, mWeb, and Desktop.

  1. Clicking + (FAB) Button
  2. Clicking on the scan request
  3. Upload an image for receipt
  4. Go to a confirmation page
  5. Refresh the page
  6. Verify that the App navigates back to the Scan Request Page
  7. 👍 or 👎

@johncschuster Could you give us the payment summary? I'll request the payment in NewDot, thanks!

@luacmartins
Copy link
Contributor

luacmartins commented Oct 25, 2023

Thanks for filling the checklist. 👍 to the regression tests

@mollfpr
Copy link
Contributor

mollfpr commented Oct 27, 2023

@johncschuster Could you give us the payment summary? Thank you!

@melvin-bot melvin-bot bot added the Overdue label Oct 30, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 30, 2023

@johncschuster, @luacmartins, @mollfpr, @DylanDylann Whoops! This issue is 2 days overdue. Let's get this updated quick!

@luacmartins
Copy link
Contributor

Just pending payment

@melvin-bot melvin-bot bot removed the Overdue label Oct 30, 2023
@johncschuster
Copy link
Contributor

On it!

@johncschuster
Copy link
Contributor

Payment Summary:

External issue reporter: @alitoshmatov - $50 - paid via Upwork
Contributor that fixed the issue: @DylanDylann - $500 - paid via Upwork
Contributor+ that helped on the issue and/or PR: @mollfpr - $500 - paid via manual request

@johncschuster
Copy link
Contributor

Payment has been issued via Upwork

@JmillsExpensify
Copy link

$500 payment approved for @mollfpr based on summary above.

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. Daily KSv2 External Added to denote the issue can be worked on by a contributor
Projects
None yet
Development

No branches or pull requests

8 participants