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-06-06] [$250] RHP - User remains on the Private Notes page when clicked on back btn after reload #40502

Closed
2 of 6 tasks
lanitochka17 opened this issue Apr 18, 2024 · 35 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 Apr 18, 2024

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Version Number: 1.4.63-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: N/A
Issue reported by: Applause - Internal Team

Action Performed:

  1. Open https://staging.new.expensify.com/
  2. Navigate to any conversation with other user
  3. Click on Header to open Profile page
  4. Click on Private Notes
  5. Reload the page
  6. Click on back button
  7. Click on back button again

Expected Result:

User should be redirected to Profile page when clicked back button

Actual Result:

User remains on the Private Notes page when clicked on back button after page reload. When user clicked on back button again the RHP will be closed

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

Bug6454034_1713463346120.Screen_Recording_2024-04-18_at_20.55.17.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01f0ae1b806ad11050
  • Upwork Job ID: 1781084747484880896
  • Last Price Increase: 2024-04-18
  • Automatic offers:
    • shubham1206agra | Reviewer | 0
    • nkdengineer | Contributor | 0
Issue OwnerCurrent Issue Owner: @shubham1206agra
@lanitochka17 lanitochka17 added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Apr 18, 2024
Copy link

melvin-bot bot commented Apr 18, 2024

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

@mallenexpensify 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

@abzokhattab
Copy link
Contributor

abzokhattab commented Apr 18, 2024

Proposal

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

RHP closes when clicking on the back button in the private notes list page

What is the root cause of that problem?

we use the default navigation behaviour in the private notes list which dismisses the navigation if no route is found in the navigation history

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

since the back navigation for the private notes history is deterministic and always goes to the report details page then we can specify that behavior in the onBackButtonPress

                onBackButtonPress={() => ReportUtils.goBackToDetailsPage(report)}

@shahinyan11
Copy link

shahinyan11 commented Apr 18, 2024

Proposal

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

RHP - User remains on the Private Notes page when clicked on back btn after reload

What is the root cause of that problem?

Here in the PRIVATE_NOTES_EDIT page we always go to PRIVATE_NOTES_LIST page using Navigation.goBack method by clicking back button. When we pass the fallbackRoute param in the Navigation.goBack method, it only goes to that route if the current route is the first one in the navigation stack, otherwise it goes back to the previous route. And so the current screen becomes first one in navigation stack, we navigate to the fallbackRoute after clicking the back button.

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

  1. Add ability to receive backTo param for ROUTES.PRIVATE_NOTES_EDIT.getRoute method. To do this update this line as below
getRoute: (reportID: string, accountID: string | number, backTo?: string) => getUrlWithBackToParam(`r/${reportID}/notes/${accountID}/edit` as const, backTo),
  1. Add Navigation.getActiveRoute() as third ( backTo ) param in getRoute methods here and here

  2. Update this line like below

onBackButtonPress={() => Navigation.goBack(route.params?.backTo)}

What alternative solutions did you explore? (Optional)

@mallenexpensify mallenexpensify added the External Added to denote the issue can be worked on by a contributor label Apr 18, 2024
Copy link

melvin-bot bot commented Apr 18, 2024

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

@melvin-bot melvin-bot bot changed the title RHP - User remains on the Private Notes page when clicked on back btn after reload [$250] RHP - User remains on the Private Notes page when clicked on back btn after reload Apr 18, 2024
@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Apr 18, 2024
Copy link

melvin-bot bot commented Apr 18, 2024

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

@mallenexpensify
Copy link
Contributor

Was able to repro, seems like it can be external, @shubham1206agra , can you review the bug and proposals above? Thx

2024-04-18_15-16-59.mp4

@nkdengineer
Copy link
Contributor

Proposal

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

User remains on the Private Notes page when clicked on back button after page reload. When user clicked on back button again the RHP will be closed

What is the root cause of that problem?

We always fallback go back to private note list page here

onBackButtonPress={() => Navigation.goBack(ROUTES.PRIVATE_NOTES_LIST.getRoute(report.reportID))}

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

We should use the same check as we do here to go to the private note edit or private note list page.

App/src/libs/ReportUtils.ts

Lines 5622 to 5628 in 68e6962

const currentUserPrivateNote = report.privateNotes?.[session.accountID]?.note ?? '';
if (isEmpty(currentUserPrivateNote)) {
Navigation.navigate(ROUTES.PRIVATE_NOTES_EDIT.getRoute(report.reportID, session.accountID));
return;
}
Navigation.navigate(ROUTES.PRIVATE_NOTES_LIST.getRoute(report.reportID));
}

  1. Create a utils like goBackFromPrivateNotes in ReportUtils. If currentUserPrivateNote is empty we will go back to to detail page by using goBackToDetailsPage function. Otherwise fallback to private note list.
function goBackFromPrivateNotes(report: OnyxEntry<Report>, session: OnyxEntry<Session>) {
    if (isEmpty(report) || isEmpty(session) || !session.accountID) {
        return;
    }
    const currentUserPrivateNote = report.privateNotes?.[session.accountID]?.note ?? '';
    if (isEmpty(currentUserPrivateNote)) {
        goBackToDetailsPage(report);
        return;
    }
    Navigation.goBack(ROUTES.PRIVATE_NOTES_LIST.getRoute(report.reportID));
}
  1. In PrivateNotesEditPage, subscribe session from Onyx. And then call goBackFromPrivateNotes function here
onBackButtonPress={() => ReportUtils.goBackFromPrivateNotes(report, session)} 

onBackButtonPress={() => Navigation.goBack(ROUTES.PRIVATE_NOTES_LIST.getRoute(report.reportID))}

What alternative solutions did you explore? (Optional)

NA

@dragnoir
Copy link
Contributor

dragnoir commented Apr 19, 2024

Proposal

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

RHP - User remains on the Private Notes page when clicked on back btn after reload

What is the root cause of that problem?

PrivateNotesEditPage is navigating back to ROUTES.PRIVATE_NOTES_LIST here

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

The page is used on many details page, the back button should be general not specific. As we do on ReportSettingsPage

onBackButtonPress={() => Navigation.goBack(ROUTES.REPORT_WITH_ID_DETAILS.getRoute(reportID))}

We should use ROUTES.REPORT_WITH_ID_DETAILS

- onBackButtonPress={() => Navigation.goBack(ROUTES.PRIVATE_NOTES_LIST.getRoute(report.reportID))}
+ onBackButtonPress={() => Navigation.goBack(ROUTES.REPORT_WITH_ID_DETAILS.getRoute(report.reportID))}

Note

using onBackButtonPress={() => ReportUtils.goBackToDetailsPage(report)} can work only on the profile page but we use notes on many details pages

POC:

20240419_113926.mp4

@mallenexpensify
Copy link
Contributor

@shubham1206agra plz review proposals above, thx.

@melvin-bot melvin-bot bot added the Overdue label Apr 22, 2024
@kaushiktd
Copy link
Contributor

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

RHP - User remains on the Private Notes page when clicked on back btn after reload

What is the root cause of that problem?

The user remains on the Private Notes page when clicking the back button after a page reload. Subsequently, clicking the back button again results in the Right Hand Pane (RHP) being closed instead of navigating to the expected profile page.

The reason for this behavior is that the PrivateNotesEditPage component is incorrectly navigating back to ROUTES.PRIVATE_NOTES_LIST when the back button is pressed. However, the intended behavior is to navigate back to the profile page (ROUTES.PROFILE).

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

add variable
const participantAccountID = report.participantAccountIDs && report.participantAccountIDs.length > 0
? report.participantAccountIDs[0]
: null;

Replace the existing navigation code:

onBackButtonPress={() => Navigation.goBack(ROUTES.PRIVATE_NOTES_LIST.getRoute(report.reportID))}

With the updated navigation code to navigate to the profile page:
onBackButtonPress={() => Navigation.goBack(ROUTES.PROFILE.getRoute(participantAccountID))}

video:-https://drive.google.com/file/d/1YeP1T1ycClNsbVIoWxO9PXRDz6rtRfxw/view?usp=sharing

@shubham1206agra
Copy link
Contributor

Well, I am going to go ahead with @nkdengineer's proposal with one side note, i.e., we should use a modified version of navigateToDetailsPage instead of goBackToDetailsPage.

🎀👀🎀 C+ reviewed

Copy link

melvin-bot bot commented Apr 22, 2024

Triggered auto assignment to @mountiny, 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 Apr 22, 2024
Copy link

melvin-bot bot commented Apr 22, 2024

📣 @shubham1206agra 🎉 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 Apr 22, 2024

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

@shahinyan11
Copy link

shahinyan11 commented Apr 22, 2024

@shubham1206agra @mountiny Are you sure that whenever currentUserPrivateNote is empty, we should go to the details page.
Could you give your opinion on my proposal? I want to understand what is the advantage of @nkdengineer's propsal compared to mine

@dragnoir
Copy link
Contributor

@shubham1206agra thank you for your review.

I feel that my proposal is simple and effective. When you have time, can you pls share your opinion about t it? Thank you for your time.

@melvin-bot melvin-bot bot added Monthly KSv2 and removed Weekly KSv2 labels May 20, 2024
Copy link

melvin-bot bot commented May 20, 2024

This issue has not been updated in over 15 days. @mallenexpensify, @mountiny, @shubham1206agra, @nkdengineer eroding to Monthly issue.

P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!

@mallenexpensify
Copy link
Contributor

Seems to have gone a bit stale but... we're in a merge freeze now so the PR should be deployed soon

@mallenexpensify mallenexpensify added Weekly KSv2 and removed Monthly KSv2 labels May 22, 2024
@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels May 30, 2024
@melvin-bot melvin-bot bot changed the title [$250] RHP - User remains on the Private Notes page when clicked on back btn after reload [HOLD for payment 2024-06-06] [$250] RHP - User remains on the Private Notes page when clicked on back btn after reload May 30, 2024
Copy link

melvin-bot bot commented May 30, 2024

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

@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label May 30, 2024
Copy link

melvin-bot bot commented May 30, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.77-11 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-06-06. 🎊

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

Copy link

melvin-bot bot commented May 30, 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:

  • [@shubham1206agra] The PR that introduced the bug has been identified. Link to the PR:
  • [@shubham1206agra] 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:
  • [@shubham1206agra] 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:
  • [@shubham1206agra] Determine if we should create a regression test for this bug.
  • [@shubham1206agra] 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.
  • [@mallenexpensify] 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 Overdue and removed Weekly KSv2 labels Jun 6, 2024
Copy link

melvin-bot bot commented Jun 11, 2024

@mallenexpensify, @mountiny, @shubham1206agra, @nkdengineer Eep! 4 days overdue now. Issues have feelings too...

@mallenexpensify
Copy link
Contributor

mallenexpensify commented Jun 12, 2024

Contributor: @nkdengineer paid $250 via Upwork
Contributor+: @shubham1206agra paid $250 via Upwork.

@shubham1206agra , can you please accept the job and reply here once you have?
https://www.upwork.com/jobs/~01435fc0aa943015f5

@shubham1206agra can you also fill out the BZ checklist? Thx

Sorry I missed this (not sure how)

@shubham1206agra
Copy link
Contributor

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:

Copy link

melvin-bot bot commented Jun 17, 2024

@mallenexpensify, @mountiny, @shubham1206agra, @nkdengineer Eep! 4 days overdue now. Issues have feelings too...

@melvin-bot melvin-bot bot added the Overdue label Jun 17, 2024
Copy link

melvin-bot bot commented Jun 19, 2024

@mallenexpensify, @mountiny, @shubham1206agra, @nkdengineer 6 days overdue. This is scarier than being forced to listen to Vogon poetry!

@nkdengineer
Copy link
Contributor

@mallenexpensify I think we can process payment now and then we can close this issue.

Copy link

melvin-bot bot commented Jun 21, 2024

@mallenexpensify, @mountiny, @shubham1206agra, @nkdengineer 8 days overdue is a lot. Should this be a Weekly issue? If so, feel free to change it!

@mallenexpensify
Copy link
Contributor

Closing, everyone's paid. I created a TestRail GH too

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
No open projects
Archived in project
Development

No branches or pull requests

9 participants