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-20] [$250] Track expense - Clicking back navigates user back to the share with my accountant flow #45774

Closed
1 of 6 tasks
lanitochka17 opened this issue Jul 19, 2024 · 53 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review Weekly KSv2

Comments

@lanitochka17
Copy link

lanitochka17 commented Jul 19, 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: 9.0.9-1
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail: N/A
Issue reported by: Applause - Internal Team

Action Performed:

  1. Navigate to staging.new.expensify.com
  2. Go to your chat and create a track expense
  3. Click on "Share with my accountant" on the actionable whisper for the track expense
  4. Go with the flow until the end
  5. Click on the browser back button

Expected Result:

App should navigate user back to the previously opened chat report

Actual Result:

App navigates user back to the "Share with my accountant" flow and user can go through the previously done flow again

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

Bug6546965_1721374708001.bandicam_2024-07-19_10-33-52-805.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01b38481aa14324c79
  • Upwork Job ID: 1815753645056507384
  • Last Price Increase: 2024-08-27
  • Automatic offers:
    • c3024 | Reviewer | 103784904
    • shubham1206agra | Contributor | 103784908
Issue OwnerCurrent Issue Owner: @c3024
@lanitochka17 lanitochka17 added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Jul 19, 2024
Copy link

melvin-bot bot commented Jul 19, 2024

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

@lanitochka17
Copy link
Author

We think that this bug might be related to #vip-vsp

@lanitochka17
Copy link
Author

@dylanexpensify FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors

@melvin-bot melvin-bot bot added the Overdue label Jul 22, 2024
@c3024

This comment was marked as outdated.

Copy link

melvin-bot bot commented Jul 22, 2024

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

@dylanexpensify dylanexpensify added the External Added to denote the issue can be worked on by a contributor label Jul 23, 2024
@melvin-bot melvin-bot bot changed the title Track expense - Clicking back navigates user back to the share with my accountant flow [$250] Track expense - Clicking back navigates user back to the share with my accountant flow Jul 23, 2024
Copy link

melvin-bot bot commented Jul 23, 2024

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

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

melvin-bot bot commented Jul 23, 2024

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

@melvin-bot melvin-bot bot removed the Overdue label Jul 23, 2024
@dylanexpensify
Copy link
Contributor

reviewed

@Zakpak0
Copy link
Contributor

Zakpak0 commented Jul 24, 2024

Proposal

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

When using the browser's back button to navigate after sharing an expense there share modal needs to be closed.

What is the root cause of that problem?

There is no action being made to close the modal after sharing the expense and navigating to the next page.

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

We can dismiss the modal, then we need to wait for it to be removed from our navigation state before we move forward.
Then we can navigate to our workspace and finally open the invite panel.
src/libs/actions/IOU.ts

    switch (action) {
        case CONST.IOU.ACTION.SHARE: {
            Navigation.dismissModal(linkedTrackedExpenseReportID)
            Navigation.isNavigationReady().then(() => { 
                Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(activeReportID ?? "-1"))
                Navigation.isNavigationReady().then(() => {
                Navigation.navigate(ROUTES.ROOM_INVITE.getRoute(activeReportID ?? '-1', CONST.IOU.SHARE.ROLE.ACCOUNTANT));
                })      
            })
            break
        }
        default: {
            Navigation.dismissModal(activeReportID);
        }
    }

Additionally I noticed the same issue with the "Invite to workspace" modal. It will cause the same problem so we should dismiss that as well.
src/pages/RoomInvitePage.tsx

        Navigation.dismissModal(reportID ?? "-1")
        Navigation.navigate(backRoute);

Here is a test branch with my changes

What alternative solutions did you explore? (Optional)

N/A

@c3024
Copy link
Contributor

c3024 commented Jul 24, 2024

Thanks for your proposal @Zakpak0 .

When the right hand panel opens with the Invite Page, the Centre Pane should show the workspace chat. I tested your branch. It shows the selfDM chat in the Center Pane when the Invite Page appears in the Share to accountant flow.

Could you fix that?

@Zakpak0
Copy link
Contributor

Zakpak0 commented Jul 24, 2024

Proposal

Updated
No problem @c3024 , for that I needed to change the order of operations.
I updated the branch with the change as well

@c3024
Copy link
Contributor

c3024 commented Jul 24, 2024

Browser back button on Invite Page in Right Hand Panel (RHP) takes the user to Share RHP with the latest branch. This should not happen.

backShare.mp4

@Zakpak0
Copy link
Contributor

Zakpak0 commented Jul 24, 2024

Proposal

Updated
@c3024 I updated it so that it handles pressing back from the RHP back button.
One thing I noticed though was that you must directly navigate to the workspace before you can handle the navigation to the RHP invite overlay.
This RHP navigation route being independent of the report we have open seems to be intentional?
Another thing is we must wait for the navigation state to be updated before we move on to our next navigation command.
Otherwise we won't be editing the state correctly.

issue-45774.mp4

Copy link

melvin-bot bot commented Jul 29, 2024

@dylanexpensify, @c3024 Huh... This is 4 days overdue. Who can take care of this?

@melvin-bot melvin-bot bot added the Overdue label Jul 29, 2024
@c3024
Copy link
Contributor

c3024 commented Jul 30, 2024

@Zakpak0 That branch works, but it seems more like a workaround to delay navigation to the room invite page. Navigation is ready all the time in this case. isNavigationReady is always true once the NavigationContainer is mounted. So, checking if it is ready only delays the navigation to the invite page slightly because it’s being done in the .then chained to the isNavigationReady promise.

I think the current bug is due to navigating to the room invite page before dismissModal is fully complete. We need something like a dismissModalWithPromise, as seen in this branch, to ensure that navigation to the room invite page happens only after dismissModal is fully complete. This also allows for reuse of this new function in other cases where navigation might occur before dismissModal is complete.

@melvin-bot melvin-bot bot removed the Overdue label Jul 30, 2024
Copy link

melvin-bot bot commented Jul 30, 2024

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

@Zakpak0
Copy link
Contributor

Zakpak0 commented Aug 1, 2024

@c3024 thanks, this makes a lot of sense. I'm going to check this out right now!

Copy link

melvin-bot bot commented Aug 2, 2024

@dylanexpensify @c3024 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 melvin-bot bot added the Overdue label Aug 2, 2024
Copy link

melvin-bot bot commented Aug 27, 2024

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

Copy link

melvin-bot bot commented Aug 28, 2024

@dylanexpensify, @c3024 10 days overdue. Is anyone even seeing these? Hello?

@c3024
Copy link
Contributor

c3024 commented Aug 29, 2024

I'll update.

@melvin-bot melvin-bot bot removed the Overdue label Aug 29, 2024
@c3024
Copy link
Contributor

c3024 commented Aug 31, 2024

I am not sure if the task queued in the microtask queue always gets executed after the dismiss modal action is complete. The dismiss modal action might take a bit longer, and since the navigate action is in a different promise chain, it might get executed earlier.

Ideally, we should chain the navigate action to a dismiss modal action function returning a promise, like this.

However, in practice, the delay caused by adding the navigate action to the microtask queue seems to be sufficient for the dismiss modal action to complete. Therefore, the added verbosity and complexity of creating another dismissModal function that returns a promise might not be worth it.

@WojtekBoman and @shubham1206agra's proposals here and here LGTM!

🎀 👀 🎀 C+ Reviewed

Copy link

melvin-bot bot commented Aug 31, 2024

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

@cead22
Copy link
Contributor

cead22 commented Sep 2, 2024

@WojtekBoman and @shubham1206agra's proposals here and here LGTM!

@c3024 sorry, can you clarify which one you selected?

@melvin-bot melvin-bot bot added the Overdue label Sep 2, 2024
@c3024
Copy link
Contributor

c3024 commented Sep 2, 2024

Both proposals are the same. @WojtekBoman is an expert agency member. I think @shubham1206agra asked him for the fix for this on Slack here and he posted a proposal in the standard format with the same solution. So, I guess Shubham will work on it if he is assigned.

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

melvin-bot bot commented Sep 2, 2024

📣 @c3024 🎉 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 Sep 2, 2024

📣 @shubham1206agra 🎉 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 📖

Copy link

melvin-bot bot commented Sep 5, 2024

@cead22, @shubham1206agra, @dylanexpensify, @c3024 Whoops! This issue is 2 days overdue. Let's get this updated quick!

@melvin-bot melvin-bot bot added the Overdue label Sep 5, 2024
@shubham1206agra
Copy link
Contributor

I will raise the PR toady.

@c3024
Copy link
Contributor

c3024 commented Sep 14, 2024

Automation failed here. Deployed to production on 13-Sep. I think this should be on HOLD for payment till 20-Sep or 21-Sep.

cc: @dylanexpensify

@dylanexpensify
Copy link
Contributor

Payment summary:

Contributor: @shubham1206agra $250
Contributor+: @c3024 $250

Please apply/request!

@dylanexpensify dylanexpensify changed the title [$250] Track expense - Clicking back navigates user back to the share with my accountant flow [Hold for payment: 2024-09-20] [$250] Track expense - Clicking back navigates user back to the share with my accountant flow Sep 18, 2024
@shubham1206agra
Copy link
Contributor

@dylanexpensify I accepted the offer

@c3024
Copy link
Contributor

c3024 commented Sep 23, 2024

Gentle bump for payment @dylanexpensify

@dylanexpensify
Copy link
Contributor

done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review Weekly KSv2
Projects
None yet
Development

No branches or pull requests

8 participants