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-02-07] [$500] Web - Chat- Hmm it's not here page displayed on reloading page after selecting Request money #33990

Closed
1 of 6 tasks
lanitochka17 opened this issue Jan 5, 2024 · 69 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 Jan 5, 2024

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.4.22-0
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: Applause - Internal Team
Slack conversation:

Action Performed:

  1. Login with gmail account on ND site
    2.Go to any 1:1 DM
  2. Tap + FAB button
  3. Select either Manual, Scan or Distance option
  4. Reload page

Expected Result:

Previous opened chat history should display on reloading page after selecting Request money options

Actual Result:

Hmm... it's not here page displayed on reloading page after selecting Request money

Workaround:

Unknown

Platforms:

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

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

Screenshots/Videos

Add any screenshot/video evidence

Bug6332682_1704414716168.New_video.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01356e28bc3ed07d0f
  • Upwork Job ID: 1743071894141489152
  • Last Price Increase: 2024-01-19
  • Automatic offers:
    • cubuspl42 | Reviewer | 28120404
    • DylanDylann | Contributor | 28120405
@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 Jan 5, 2024
Copy link

melvin-bot bot commented Jan 5, 2024

Job added to Upwork: https://www.upwork.com/jobs/~01356e28bc3ed07d0f

@melvin-bot melvin-bot bot changed the title Web - Chat- Hmm it's not here page displayed on reloading page after selecting Request money [$500] Web - Chat- Hmm it's not here page displayed on reloading page after selecting Request money Jan 5, 2024
Copy link

melvin-bot bot commented Jan 5, 2024

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

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Jan 5, 2024
Copy link

melvin-bot bot commented Jan 5, 2024

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

Copy link

melvin-bot bot commented Jan 5, 2024

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

@unidev727
Copy link
Contributor

unidev727 commented Jan 5, 2024

Proposal

from: @unicorndev-727

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

Chat- Hmm it's not here page displayed on reloading page after selecting Request money.

What is the root cause of that problem?

The root cause is that we use new reportId(doesn't exist) when we create money request and CustomRouter returns random reportId for CENTRAL_PANE_NAVIGATOR here in this case without checking report.

create/request/start/1/8425039469826829/manual | scan | distance
The route has reportId param so the getLastAccessedReportID doesn't work in these 3 routes.

return topmostRoute.params.reportID;
}

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

We should check if report exists regardless reportId is valid here and if report doesn't exist, we shouldn't return that reportId.

if (topmostRoute?.params && 'reportID' in topmostRoute.params && typeof topmostRoute.params.reportID === 'string' && topmostRoute.params.reportID) {
return topmostRoute.params.reportID;
}

to

if (topmostRoute?.params && 'reportID' in topmostRoute.params && typeof topmostRoute.params.reportID === 'string' && topmostRoute.params.reportID && ReportUtils.getReport(topmostRoute.params.reportID)?.reportID) {
        return topmostRoute.params.reportID;
}
screen-capture.4.webm

What alternative solutions did you explore?

N/A

@tienifr
Copy link
Contributor

tienifr commented Jan 5, 2024

Proposal

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

Hmm... it's not here page displayed on reloading page after selecting Request money

What is the root cause of that problem?

When creating money request via FAB, we'll generate a random reportID and put in the route. When reloading we're unable to find the report associated with that reportID so this issue happens.

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

If we're on the request money/split bill/related route, and we cannot find any report matching reportID in Onyx, in here fallback to the getLastAccessedReportID.

We can optionally optimistically create the report for those reportID as well, with the isOptimisticReport: true field, and when we find the request money/split bill report by the reportID, if what we found is an optimistic report, then fallback to using getLastAccessedReportID. We can then clear this optimistic report when we complete/get out of the money request flow.

What alternative solutions did you explore? (Optional)

NA

@yh-0218
Copy link
Contributor

yh-0218 commented Jan 5, 2024

Proposal

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

Hmm... it's not here page displayed on reloading page after selecting Request money

What is the root cause of that problem?

When we create money request via FAB, we generate a random reportID and put in the route.
This random reportID make this issue.

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

We need to compare route?.params?.reportID and getLastAccessedReportID here

if (route?.params?.reportID === reportID) {

What alternative solutions did you explore? (Optional)

Screen.Recording.2024-01-05.at.7.02.48.AM.mov

@DylanDylann
Copy link
Contributor

DylanDylann commented Jan 5, 2024

Proposal

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

  • Web - Chat- Hmm it's not here page displayed on reloading page after selecting Request money

What is the root cause of that problem?

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

const getTopMostReportIDFromRHP = (state: State): string => {
    if (!state) {
        return '';
    }
    const topmostRightPane = state.routes.filter((route) => route.name === NAVIGATORS.RIGHT_MODAL_NAVIGATOR).at(-1);

    if (topmostRightPane?.state) {
        return getTopMostReportIDFromRHP(topmostRightPane.state);
    }
    const topmostRoute = state.routes.at(-1);
+  if (topmostRoute?.params && topmostRoute.params.iouType === "request") {
+        return '';
+    }

    if (topmostRoute?.state) {
        return getTopMostReportIDFromRHP(topmostRoute.state);
    }
    if (topmostRoute?.params && 'reportID' in topmostRoute.params && typeof topmostRoute.params.reportID === 'string' && topmostRoute.params.reportID) {
        return topmostRoute.params.reportID;
    }

    return '';
};

What alternative solutions did you explore? (Optional)

  • NA

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

melvin-bot bot commented Jan 8, 2024

@cubuspl42, @adelekennedy Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@adelekennedy
Copy link

@cubuspl42 it looks like there are a few proposals to review!

@melvin-bot melvin-bot bot removed the Overdue label Jan 8, 2024
@cubuspl42
Copy link
Contributor

@unicorndev-727

We need to consider above 3 routes so that getLastAccessedReportID works properly.

Consider how? I don't understand your solution, sorry.

@tienifr

fallback to the getLastAccessedReportID.

What's the UX of this solution? Does the "random" report ID stay in the URL bar?

We can optionally optimistically create the report for those reportID as well

This brings garbage collection challenges... Do you think this is a realistic option? Anything goes "wrong" (the user closes a tab, whatever) and we're left with garbage in this solution, right?

@DylanDylann

I think we have a different understanding what a deeplink is. In the context of this Web-specific issue, you probably just mean "URL".

We need to make sure when we open ... app does not add the report screen with reportID = 317873788367143 to CENTRAL_PANE_NAVIGATOR

You stick to the example, but what's the logic of the suggested solution?

I guess that it's something like "when te report ID in the URL points to a non-existing report, we...", but you didn't state this explicitly. Examples are good, but they can't be the only thing describing a solution.

We can update getTopMostReportIDFromRHP to:

You said "can". Is it an optional part of the solution?

Let's focus on the code diff now.

First, a nit. Isn't topmostRoute?.params && topmostRoute.params.iouType equivalent to topmostRoute?.params?.iouType (when converted to a boolean)?

Leaving nits aside... From the proposal itself, I don't think it's clear how the first change (not adding a route with invalid report ID to CENTRAL_PANE_NAVIGATOR) relates to the second (adjusting getTopMostReportIDFromRHP).

@unidev727
Copy link
Contributor

unidev727 commented Jan 9, 2024

@unicorndev-727

We need to consider above 3 routes so that getLastAccessedReportID works properly.

Consider how? I don't understand your solution, sorry.

if (route?.params?.reportID) {

We need to add a new condition here if report with this reportId exists.

if (route?.params?.reportID && ReportUtils.getReport(route.params.reportID)) {

So if report doesn't exist, we can set lase accessed report id from getLastAccessedReportID.

@unidev727
Copy link
Contributor

@cubuspl42
I updated the proposal and added the result video.

@cubuspl42
Copy link
Contributor

@unicorndev-727

So, what actually happens after the reload in the proposed solution, as I understand it:

  • In the URL, we present the old random ID of a temporary report (which doesn't exist anymore)
  • The RHP presents the "Request money" flow associated with a new report with a new random ID

Is this correct?

@unidev727
Copy link
Contributor

Now it is.

@cubuspl42
Copy link
Contributor

This is a bit work-aroundish, if not hacky, to present some "garbage" from the URL, just because it makes the implementation easier.

@cubuspl42
Copy link
Contributor

Everyone,

I do not understand one important high-level thing here. Wy do we include the report ID in the URL, if this is not a persisted entity?

Why... /create/request/start/1/317873788367143/manual
Why not... /create/request/start/1/manual

Also, what is 1?

@unidev727
Copy link
Contributor

That is transactionID.

MONEY_REQUEST_CREATE: {
        route: 'create/:iouType/start/:transactionID/:reportID',
        getRoute: (iouType: ValueOf<typeof CONST.IOU.TYPE>, transactionID: string, reportID: string) => `create/${iouType}/start/${transactionID}/${reportID}` as const,
    },

@DylanDylann
Copy link
Contributor

DylanDylann commented Jan 9, 2024

@cubuspl42 I updated proposal based on your comment

@cubuspl42
Copy link
Contributor

cubuspl42 commented Jan 9, 2024

@DylanDylann Oh, I misunderstood your proposal structure. The second bullet is the implementation of the idea from the first one. This changes a lot.

Again, nit: Isn't this equivalent to topmostRoute?.params?.iouType === "request"?

Also, what's the UX of this solution? How does the URL behave from user's perspective? Does the "old" random ID stay in the URL bar?

@DylanDylann
Copy link
Contributor

@cubuspl42

Isn't this equivalent to topmostRoute?.params?.iouType === "request"?

What is "this" here?

Does the "old" random ID stay in the URL bar?

Yes. Because when user opens /create/request/start/1/317873788367143/manual, the RequestMoney screen is focused, so the reportID 317873788367143 still stays in the URL bar

@melvin-bot melvin-bot bot added the Overdue label Jan 22, 2024
@cubuspl42
Copy link
Contributor

Still active discussion

@adelekennedy
Copy link

clearing the overdue - still discussion above

@adelekennedy
Copy link

Hmm - I'm not sure why the overdue didn't clear. testing.

@melvin-bot melvin-bot bot removed the Overdue label Jan 23, 2024
@cubuspl42
Copy link
Contributor

cubuspl42 commented Jan 24, 2024

Let's assign @DylanDylann.

We'll change the app behavior to always present the last visited report in the central pane, regardless of the reportId (the pre-set money request participant) in the URL.

@DylanDylann persistently presented the benefits of his idea and got it approved by the internal engineer.

C+ reviewed 🎀 👀 🎀

Copy link

melvin-bot bot commented Jan 24, 2024

Triggered auto assignment to @francoisl, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Jan 24, 2024
Copy link

melvin-bot bot commented Jan 24, 2024

📣 @cubuspl42 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job

Copy link

melvin-bot bot commented Jan 24, 2024

📣 @DylanDylann 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job
Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Keep in mind: Code of Conduct | Contributing 📖

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Jan 25, 2024
@DylanDylann
Copy link
Contributor

@cubuspl42 PR #35210 is ready to review

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Jan 31, 2024
@melvin-bot melvin-bot bot changed the title [$500] Web - Chat- Hmm it's not here page displayed on reloading page after selecting Request money [HOLD for payment 2024-02-07] [$500] Web - Chat- Hmm it's not here page displayed on reloading page after selecting Request money Jan 31, 2024
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Jan 31, 2024
Copy link

melvin-bot bot commented Jan 31, 2024

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

Copy link

melvin-bot bot commented Jan 31, 2024

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:

Copy link

melvin-bot bot commented Jan 31, 2024

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:

  • [@cubuspl42 / @DylanDylann] The PR that introduced the bug has been identified. Link to the PR:
  • [@cubuspl42 / @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:
  • [@cubuspl42 / @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:
  • [@cubuspl42 / @DylanDylann] Determine if we should create a regression test for this bug.
  • [@cubuspl42 / @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.
  • [@adelekennedy] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Feb 6, 2024
@cubuspl42
Copy link
Contributor

  • The PR that introduced the bug has been identified. Link to the PR:
    • The old expected behavior appeared buggy from the user's perspective. There was a long discussion in which we concluded that it's best to define a new expected behavior.
  • 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:
    • No need for additional discussion
  • Determine if we should create a regression test for this bug.
    • No
  • 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.
    • N/A

@cubuspl42
Copy link
Contributor

@adelekennedy Were the payments processed?

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