Expensify / App

Welcome to New Expensify: a complete re-imagination of financial collaboration, centered around chat. Help us build the next generation of Expensify by sharing feedback and contributing to the code.
https://new.expensify.com
MIT License
3.56k stars 2.9k forks source link

[$2000] Split bill - Split bill is displayed twice if swipe back from split bill chat #22313

Closed lanitochka17 closed 1 year ago

lanitochka17 commented 1 year ago

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. Open https://staging.new.expensify.com/
  2. Tap on "+" FAB
  3. Tap "Split bill"
  4. Enter amount
  5. Tap "Next"
  6. Select users
  7. Tap "Next"
  8. Tap "Split"
  9. Swipe to the right
  10. Swipe to the right again

Expected Result:

User lands in LHN either at step 9 or 10

Actual Result:

"Split bill enter mount" page is displayed twice when user swipes to the right at steps 9 and 10 from split bill chat

Workaround:

Unknown

Platforms:

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

Version Number: 1.3.37.1

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

https://github.com/Expensify/App/assets/78819774/db145200-7e46-4e93-9485-454b8a421b7f

Expensify/Expensify Issue URL:

Issue reported by: Applause - Internal Team

Slack conversation:

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~019fd945448c329b5e
  • Upwork Job ID: 1679918056642871296
  • Last Price Increase: 2023-09-05
melvin-bot[bot] commented 1 year ago

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

melvin-bot[bot] commented 1 year ago

Bug0 Triage Checklist (Main S/O)

manjesh-yadav commented 1 year ago

Proposal

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

Split bill is displayed twice if swipe back from split bill chat

What is the root cause of that problem?

We should not Enforces navigation to fallback route when a money request has already been created and we have a new moneyRequestId it forces to reload the same route again when we go back

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

We should navigate back if IOU report is already created

https://github.com/Expensify/App/blob/2607bdeeb211e2b8153b9ea6937064c27fd3d2c7/src/pages/iou/steps/MoneyRequstParticipantsPage/MoneyRequestParticipantsPage.js#L65

Changes

useEffect(() => {
        // ID in Onyx could change by initiating a new request in a separate browser tab or completing a request
        if (prevMoneyRequestId.current !== props.iou.id) {
            // The ID is cleared on completing a request. In that case, we will do nothing
            if (props.iou.id) {
                navigateBack(true);
            }
            return;
        }

        // Reset the money request Onyx if the ID in Onyx does not match the ID from params
        const moneyRequestId = `${iouType.current}${reportID.current}`;
        const shouldReset = props.iou.id !== moneyRequestId;
        if (shouldReset) {
            IOU.resetMoneyRequestInfo(moneyRequestId);
        }

        if (props.iou.amount === 0 || shouldReset) {
-            navigateBack(true);
+          navigateBack();
        }

        return () => {
            prevMoneyRequestId.current = props.iou.id;
        };
    }, [props.iou.amount, props.iou.id]);
Result Online https://github.com/Expensify/App/assets/70934016/43ee69f4-22da-40b2-aa0d-b4e1673c86e5 offline https://github.com/Expensify/App/assets/70934016/156a9e25-a28f-485f-af85-1bfa2092a384
melvin-bot[bot] commented 1 year ago

Looks like something related to react-navigation may have been mentioned in this issue discussion.

As a reminder, please make sure that all proposals are not workarounds and that any and all attempt to fix the issue holistically have been made before proceeding with a solution. Proposals to change our DeprecatedCustomActions.js files should not be accepted.

Feel free to drop a note in #expensify-open-source with any questions.

melvin-bot[bot] commented 1 year ago

@flaviadefaria Huh... This is 4 days overdue. Who can take care of this?

melvin-bot[bot] commented 1 year ago

@flaviadefaria 6 days overdue. This is scarier than being forced to listen to Vogon poetry!

melvin-bot[bot] commented 1 year ago

Job added to Upwork: https://www.upwork.com/jobs/~019fd945448c329b5e

melvin-bot[bot] commented 1 year ago

Current assignee @flaviadefaria is eligible for the External assigner, not assigning anyone new.

melvin-bot[bot] commented 1 year ago

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

flaviadefaria commented 1 year ago

Added the external label.

flaviadefaria commented 1 year ago

@parasharrajat thoughts on the proposal above?

parasharrajat commented 1 year ago

Analyzing. There is another PR that is also doing something related. Let me check if that can affect this.

parasharrajat commented 1 year ago

Phew...PR which implemented this is quite big and reading the whole discussion gave me headaches. I am still figuring out the expected behavior. Based on that I will review proposals.

Tagged useEffect in @manjesh-yadav's proposal is quite confusing. It is not very clear in which cases these resets will trigger.

melvin-bot[bot] commented 1 year ago

@parasharrajat @flaviadefaria 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!

melvin-bot[bot] commented 1 year ago

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

parasharrajat commented 1 year ago

Still reviewing the old code implementation and asking question. I will soon have an update.

bernhardoj commented 1 year ago

Leaving my comment here:

So, the real issue here is that pressing back will take the user to the split bill page again instead of LHN. This happens when we use the REPLACE action (triggered from dismissModal) and only on the web. This has the same root cause as https://github.com/Expensify/App/issues/21356. I'm suggesting to hold for that issue.

flaviadefaria commented 1 year ago

@parasharrajat do you have an update?

flaviadefaria commented 1 year ago

Friendly bump here!

parasharrajat commented 1 year ago

Thanks for the bump @flaviadefaria. I am still waiting on few things to be get cleared. Based on https://github.com/Expensify/App/issues/22313#issuecomment-1646449403, the behaviour is completely different from what is proposed.

There is another issue which aims to refactor responsible components https://github.com/Expensify/App/issues/23149.

Related discussion: https://github.com/bernhardoj/Expensify/commit/74dac7e0730409592af6225ac3bbc94ae56902ed#r122124171

So I am still unclear what should be done here. I will try to reach a conclusion.

melvin-bot[bot] commented 1 year ago

@parasharrajat @flaviadefaria this issue is now 3 weeks old. There is one more week left before this issue breaks WAQ and will need to go internal. What needs to happen to get a PR in review this week? Please create a thread in #expensify-open-source to discuss. Thanks!

melvin-bot[bot] commented 1 year ago

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

flaviadefaria commented 1 year ago

@parasharrajat have you reached nay conclusions? Do you need help? We can always take this to Slack for discussion if needed.

flaviadefaria commented 1 year ago

Friendly bump @parasharrajat!

melvin-bot[bot] commented 1 year ago

@parasharrajat @flaviadefaria this issue is now 4 weeks old and preventing us from maintaining WAQ, can you:

Thanks!

melvin-bot[bot] commented 1 year ago

Current assignee @parasharrajat is eligible for the Internal assigner, not assigning anyone new.

parasharrajat commented 1 year ago

I will be able to move ahead with this next week. Won't be available next two days.

flaviadefaria commented 1 year ago

Cool waiting for an update from you in the next days @parasharrajat.

melvin-bot[bot] commented 1 year ago

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

parasharrajat commented 1 year ago

Reviewing this issue today.

flaviadefaria commented 1 year ago

@parasharrajat do you have an update?

melvin-bot[bot] commented 1 year ago

Current assignee @flaviadefaria is eligible for the Bug assigner, not assigning anyone new.

melvin-bot[bot] commented 1 year ago

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

flaviadefaria commented 1 year ago

@greg-schroeder I'm heading OoO for a week so reassigning this in the meantime.

flaviadefaria commented 1 year ago

@parasharrajat it's been over a week since your last update can you please provide an update today? Thanks!

greg-schroeder commented 1 year ago

Yes, bump @parasharrajat!

greg-schroeder commented 1 year ago

Perhaps we should re-assign this @flaviadefaria?

melvin-bot[bot] commented 1 year ago

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

greg-schroeder commented 1 year ago

@flaviadefaria do you think we should re-assign this one?

greg-schroeder commented 1 year ago

bumped in C+ room

parasharrajat commented 1 year ago

@greg-schroeder Please reassign. I won't be able to look into this soon.

melvin-bot[bot] commented 1 year ago

Current assignee @flaviadefaria is eligible for the External assigner, not assigning anyone new.

melvin-bot[bot] commented 1 year ago

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

greg-schroeder commented 1 year ago

Re-assigning new C+ per slack thread

flaviadefaria commented 1 year ago

Thanks @greg-schroeder I was OoO but am back now and will take this over again.

flaviadefaria commented 1 year ago

@cubuspl42 once you have time to catch up on the issue please let us know what you think in terms of next steps - thanks!

melvin-bot[bot] commented 1 year ago

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

cubuspl42 commented 1 year ago

I think @parasharrajat did a good job investigating this issue. This thread is a good summary of the findings.

I'm also not completely convinced by the single proposal we have so far. In my experience, issues related to navigation might seem trivial but can be difficult to get right. I believe that in this case, raising the bounty to get more eyes on it is appropriate. When it's done, I can also post a message on Slack.

melvin-bot[bot] commented 1 year ago

Upwork job price has been updated to $2000

flaviadefaria commented 1 year ago

Raised the bounty as suggested.