Skip to content

[HOLD for payment 2024-02-07][$500] Page refresh causes manual request with a receipt to be stuck #30884

Closed

Description

@m-natarajan

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


Version Number: 1.3.95-5
Reproducible in staging?: y
Reproducible in production?: y
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
Expensify/Expensify Issue URL:
Issue reported by: @abdel-h66
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1698081033316989

Action Performed:

  1. Open a chat
  2. Create a manual request thought the chat plus icon (not the FAB)
  3. Enter an amount and Next
  4. Click the three dots on the top, and attach a receipt
  5. Refresh the page in this step
  6. The page will go back to the first step, autofilled with the previous amount.
  7. Click next

Expected Result:

We should be able to continue to the request information page

Actual Result:

The page is stuck and keeps coming back whenever Next is clicked

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

Recording.198.mp4
Expensify.bugs.mp4
Monosnap.screencast.Oct.23.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01b422f44a99747ac7
  • Upwork Job ID: 1720802592517115904
  • Last Price Increase: 2023-12-21
  • Automatic offers:
    • DylanDylann | Contributor | 28067917

Activity

  1. added
    External
    Daily
    Bug
    on Nov 4, 2023
  2. changed the title [-]Page refresh causes manual request with a receipt to be stuck[/-] [+][$500] Page refresh causes manual request with a receipt to be stuck[/+] on Nov 4, 2023
  3. melvin-bot commented on Nov 4, 2023

    @melvin-bot
  4. melvin-bot commented on Nov 4, 2023

    @melvin-bot

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

  5. melvin-bot commented on Nov 4, 2023

    @melvin-bot

    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
  6. added
    Help Wanted
    on Nov 4, 2023
  7. melvin-bot commented on Nov 4, 2023

    @melvin-bot

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

  8. DylanDylann commented on Nov 4, 2023

    @DylanDylann
    Contributor

    Proposal

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

    Page refresh causes manual request with a receipt to be stuck

    What is the root cause of that problem?

    Firstly, Let's see this issue: #28347 (similar case with scan flow)

    We discussed about this problem before with scan request. But we missed a case: the manual request by adding a receipt

    Note that if we upload the receipt and back to the participant page and then reload, the same bug also happens. This bug is mentioned here

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

    In here

    const onFailure = () => navigateToStartMoneyRequestStep(requestType, iouType, transactionID, reportID);

    We should add a check if It is a manual request and the file is lost. The app will be on the confirmation page and the receipt thumbnail is removed

    const onFailure = () => {
            console.log("onFailure: ", requestType)
            if (requestType === CONST.IOU.REQUEST_TYPE.MANUAL) {
                IOU.setMoneyRequestReceipt_temporaryForRefactor(transactionID, '', '');
                return 
            }
            navigateToStartMoneyRequestStep(requestType, iouType, transactionID, reportID)
        }
    

    With the big refactor on the request flow, navigateToStartStepIfScanFileCannotBeRead also be used in the participant page so this change also fix the bug on the participant page

    This is result

    sol.mp4

    What alternative solutions did you explore? (Optional)

    In here

    const onFailure = () => navigateToStartMoneyRequestStep(requestType, iouType, transactionID, reportID);

    We should add a check if It is a manual request and the file is lost. The app will redirect to the uploading screen

    const onFailure = () => {
            console.log("onFailure: ", requestType)
            if (requestType === CONST.IOU.REQUEST_TYPE.MANUAL) {
                Navigation.navigate(ROUTES.MONEY_REQUEST_STEP_SCAN.getRoute(iouType, transactionID, reportID, Navigation.getActiveRouteWithoutParams()));
                return 
            }
            navigateToStartMoneyRequestStep(requestType, iouType, transactionID, reportID)
        }
    
  9. dummy-1111 commented on Nov 4, 2023

    @dummy-1111
    Contributor

    Proposal

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

    After adding a receipt to the manual request, page refresh causes manual request to be stuck

    What is the root cause of that problem?

    When we adding a receipt to the manual request, we create blob URL and set it to the iou

    const filePath = URL.createObjectURL(file);
    IOU.setMoneyRequestReceipt(filePath, file.name);

    const filePath = URL.createObjectURL(imageFile);
    IOU.setMoneyRequestReceipt(filePath, imageFile.name);

    But this object URL is only valid for the current session and will be revoked once the page is refreshed. So when navigating to the confirmation page, file would be null and it'll be redirected to the manual request page or previous page.

    FileUtils.readFileAsync(props.iou.receiptPath, props.iou.receiptFilename).then((file) => {
    if (!file) {
    Navigation.goBack(ROUTES.MONEY_REQUEST.getRoute(iouType, reportID));
    } else {

    This is the root cause

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

    I don't think we need to go back to the manual request page when object URL is not valid.
    I suggest to reset the receipt in this case

    Update the above code to

            FileUtils.readFileAsync(props.iou.receiptPath, props.iou.receiptFilename).then((file) => {
                if (!file) {
                    IOU.setMoneyRequestReceipt('', '');
                } else {
    
    Result
    30884.mp4

    What alternative solutions did you explore? (Optional)

  10. DylanDylann commented on Nov 4, 2023

    @DylanDylann
    Contributor

    @s-alves10 Your proposal is the same as my alternative solution 😄 (same interesting idea)

  11. abdel-h66 commented on Nov 4, 2023

    @abdel-h66
    Contributor

    I actually reported this one and worked on a solution that I shared on Slack. Not sure why @m-natarajan didn't include it :) could you double-check again please :), and please check the Reported GitHub ID. that's not me it should be @abdel-h66

  12. 101 remaining items

  13. melvin-bot commented on Jan 31, 2024

    @melvin-bot

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

  14. removed
    Reviewing
    on Jan 31, 2024
  15. melvin-bot commented on Jan 31, 2024

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.33-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 2024-02-07. 🎊

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

  16. melvin-bot commented on Jan 31, 2024

    @melvin-bot

    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:

    • [@eVoloshchak / @DylanDylann] The PR that introduced the bug has been identified. Link to the PR:
    • [@eVoloshchak / @DylanDylann] 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:
    • [@eVoloshchak / @DylanDylann] 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:
    • [@eVoloshchak / @DylanDylann] Determine if we should create a regression test for this bug.
    • [@eVoloshchak / @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.
    • [@lschurr] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:
  17. changed the title [-][HOLD for payment 2024-02-07] [HOLD for payment 2024-01-18] [$500] Page refresh causes manual request with a receipt to be stuck[/-] [+][HOLD for payment 2024-02-07][$500] Page refresh causes manual request with a receipt to be stuck[/+] on Jan 31, 2024
  18. lschurr commented on Feb 4, 2024

    @lschurr
    Contributor

    @eVoloshchak @DylanDylann - could you work through the new checklist for this one?

  19. eVoloshchak commented on Feb 6, 2024

    @eVoloshchak
    Contributor
    • The PR that introduced the bug has been identified. Link to the PR: there isn't a PR that has caused this, this is an edge case that was missed during the initial implementation
    • 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: N/A
    • 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: we already have the necessary item in the reviewer checklist: " I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)"
    • Determine if we should create a regression test for this bug.
      Is it easy to test for this bug? Yes
      Is the bug related to an important user flow? Yes
      Is it an impactful bug? It's an edge case, but it's an edge case that completely crashes the app, I'd call that impactful

    Regression Test Proposal

    1. Open a chat
    2. Create a manual request thought the chat plus icon (not the FAB)
    3. Enter an amount and click Next
    4. Click the three dots on the top, and attach a receipt
    5. Refresh the page
    6. The page should go back to the first step, autofilled with the previous amount.
    7. Click next
    8. Verify that you're able to continue to the request information page

    Do we agree 👍 or 👎

  20. eVoloshchak commented on Feb 7, 2024

    @eVoloshchak
    Contributor

    This is ready for payment, @lschurr, could you post the payment summary please?
    Noting this has caused a regression, the amount should be $250

  21. lschurr commented on Feb 7, 2024

    @lschurr
    Contributor

    Yep, I will review and post payment summary today.

  22. added
    Daily
    and removed
    Weekly
    on Feb 7, 2024
  23. lschurr commented on Feb 7, 2024

    @lschurr
    Contributor

    Payment summary:

  24. lschurr commented on Feb 7, 2024

    @lschurr
    Contributor

    Added new QA test request: https://github.com/Expensify/Expensify/issues/367651

    Closing out this issue.

  25. JmillsExpensify commented on Feb 9, 2024

    @JmillsExpensify
    Contributor

    $250 approved for @eVoloshchak based on summary above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentBugDailyExternal

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions