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 2023-09-20] [$1000] Removing edit from URL of request money report description edit make the description page as task description #25950

Closed
1 of 6 tasks
m-natarajan opened this issue Aug 25, 2023 · 43 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

@m-natarajan
Copy link

m-natarajan commented Aug 25, 2023

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


Action Performed:

  1. Open the app
  2. Click on plus and select request money
  3. Enter any amount, select any user and complete the process
  4. Click on request money message in thread
  5. Again click on the IOU message, 'Amount', 'Description' and 'Date' fields should be visible
  6. Click on description and from URL, remove 'edit/'
  7. Observe that now it displays 'Task' in header even though URL is for request money page

Expected Result:

App should either display 'Hmm its not here' page or redirect user back to URL with 'edit/' in it

Actual Result:

App displays 'Task' in header when we remove 'edit/' from URL of request money description page

Workaround:

Unknown

Platforms:

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

  • Android / native
  • Android / Chrome
  • iOS / native
  • iOS / Safari
  • MacOS / Chrome / Safari
  • MacOS / Desktop

Version Number: 1.3.57-3
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

removing.edit.from.URL.opens.task.description.page.mp4
Recording.401.mp4

Expensify/Expensify Issue URL:
Issue reported by: @dhanashree-sawant
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1692178308914769

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01573d261a91377f32
  • Upwork Job ID: 1696496990711562240
  • Last Price Increase: 2023-08-29
  • Automatic offers:
    • mollfpr | Reviewer | 26535797
    • daordonez11 | Contributor | 26535798
    • Dhanashree-Sawant | Reporter | 26535799
@m-natarajan m-natarajan added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Aug 25, 2023
@namhihi237
Copy link
Contributor

Proposal

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

The app should either display 'Hmm its not here' page with when open edit task when the report is not found

What is the root cause of that problem?

When we delete edit on the URL, this URL is the task's edit description page. And here we have not checked whether the open report is the task or not to display the Not Found page here.

  • TaskDescriptionPage
  • TaskAssigneeSelectorModal
  • TaskTitlePage

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

We should wrap content by FullPageNotFoundView component with condition check edit task or not, and check whether the task archived

What alternative solutions did you explore? (Optional)

N/A

@melvin-bot
Copy link

melvin-bot bot commented Aug 25, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Aug 25, 2023

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

@daordonez11
Copy link
Contributor

daordonez11 commented Aug 25, 2023

Proposal

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

TaskDescriptionPage is shown in a request report

What is the root cause of that problem?

'Hmm its not here' is shown when a URL that does not exist is accessed, in this case this is known URL, specifically Task_Description hence the edit task description page is shown. Since this is an existing page we can control what to do.

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

Use the method ReportUtils.isTaskReport and validate if the loaded report is indeed a task, in case not send to the report screen. We can reuse this in Task_Title, Task_Description, Task_Assignee

if(!ReportUtils.isTaskReport(props.report)) {
        Navigation.isNavigationReady().then(() => {
            Navigation.dismissModal();
        });
    }

Solution working:

RedirectTask.-.8_25_2023.10_40_46.AM.webm

What alternative solutions did you explore? (Optional)

@neonbhai
Copy link
Contributor

neonbhai commented Aug 25, 2023

Proposal

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

Removing edit from URL of request money report description edit make the description page as task description

What is the root cause of that problem?

We are not checking on the task description page that report is indeed a task report. We should be checking the validity of the reportID and showing FullPageNotFoundView

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

We should wrap the TaskDescriptionPage with a FullPageNotFoundView which simply shows page not found if the reportID is incorrect or it is not a task.
This would mean adding the FullPageNotFoundView before this line:

<HeaderWithBackButton title={props.translate('task.task')} />
with the showShow prop checking the validity of reportID.

This should be extended to other pages in the Task Flow

What alternative solutions did you explore? (Optional)

xx

@GItGudRatio
Copy link
Contributor

Proposal

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

Removing edit from URL of request money report description edit make the description page as task description

What is the root cause of that problem?

For all other fields on the page, such as date, amount and merchant, when the /edit url is removed, the resulting URL is not used anywhere in the app, showing the page not found view.

For the description however, when /edit is removed, the URL becomes r/:reportID/description, which is used to change the description of a task report. Thus, this is a case of component popping up unexpectedly.

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

There are multiple ways to solve this inconsistency. I'll give a high level of each and we can iron out details in the PR.

Approach 1
Give unique URL paths for Task page or IOU page. We can add a new path in the existing route like for editing task, we can use r/:reportID/task/description or for getEditRequestRoute, we can use r/:threadReportID/iou/edit/:field. In this case, when /edit is removed, the URL is not used anywhere else.

Approach 2
For the edit description, title and assignee pages, we can add a FullPageNotFoundView, which checks if the report ID is for task and if not, show a Not found page.

What alternative solutions did you explore? (Optional)

N/A

@melvin-bot melvin-bot bot added the Overdue label Aug 28, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 29, 2023

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

@sonialiap
Copy link
Contributor

Reproducible
image

@melvin-bot melvin-bot bot removed the Overdue label Aug 29, 2023
@sonialiap sonialiap added the External Added to denote the issue can be worked on by a contributor label Aug 29, 2023
@melvin-bot melvin-bot bot changed the title Removing edit from URL of request money report description edit make the description page as task description [$1000] Removing edit from URL of request money report description edit make the description page as task description Aug 29, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 29, 2023

Job added to Upwork: https://www.upwork.com/jobs/~01573d261a91377f32

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Aug 29, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 29, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Aug 29, 2023

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

@mollfpr
Copy link
Contributor

mollfpr commented Aug 30, 2023

I tested the same reproduction step on the /date URL; on the production v1.3.58-5, it results not found page, but on staging/DEV, it's showing the report page instead. I wonder if it's a deploy blocker or if the behavior has changed.

Besides that, I did a test in the opposite direction. I am accessing the /edit/{field} with the task report. The result shows the report page.

const canEdit = !isSettled && !isDeleted && (isAdmin || isRequestor);
// Dismiss the modal when the request is paid or deleted
useEffect(() => {
if (canEdit) {
return;
}
Navigation.dismissModal();
}, [canEdit]);

So it's better we follow the same behavior. It looks like @daordonez11 is proposing that in their proposal.

@daordonez11 I tested your solution, but it's not working if I put a random reportID in the URL. So we need to use dismissModal instead of navigate. Another question is whether we need to use Navigation.isNavigationReady? I see that we don't use it in the EditRequestPage.

@daordonez11
Copy link
Contributor

Hey @mollfpr you are right regarding the random id, we would have to validate in some way if its an existent report, better just to use dismissModal.

isNavigationReady is required because this error can be reproduced in a new tab just by using the "wrong URL" in this case that line is reached before navigation is ready that why its required just an edge case I tested the day I created the proposal.

@mollfpr
Copy link
Contributor

mollfpr commented Aug 31, 2023

isNavigationReady is required because this error can be reproduced in a new tab just by using the "wrong URL" in this case that line is reached before navigation is ready that why its required just an edge case I tested the day I created the proposal.

@daordonez11 Could you share a video of this case?

@melvin-bot melvin-bot bot added the Overdue label Sep 4, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 4, 2023

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

@mollfpr
Copy link
Contributor

mollfpr commented Sep 4, 2023

Friendly bump @daordonez11 on the comment

@melvin-bot melvin-bot bot removed the Overdue label Sep 4, 2023
@daordonez11
Copy link
Contributor

daordonez11 commented Sep 4, 2023

Here it is @mollfpr first time it tries to dismiss it fails:
image

In the end, it hides the modal due to a rerender of TaskDescriptionPage. In that second render the navigation is ready and it is dismissed.

Dismiss.Modal.fails-.9_4_2023.3_40_30.PM.webm

@mollfpr
Copy link
Contributor

mollfpr commented Sep 5, 2023

Thanks @daordonez11

The proposal from @daordonez11 looks good to me. When accessing the edit page on request with task report ID, we are already navigating to the report page, explained here. So, let's do the same thing for the description page for the task report.

@daordonez11 Could you update your proposal by using the Navigation.dismissModal instead?

🎀 👀 🎀 C+ reviewed!

@mollfpr
Copy link
Contributor

mollfpr commented Sep 7, 2023

Besides that, I did a test in the opposite direction. I am accessing the /edit/{field} with the task report. The result shows the report page.

@daordonez11 Could you check if it's resulting the same as the above test?

@daordonez11
Copy link
Contributor

Yup I can confirm its the same behavior @mollfpr

Same.Behavior.-.9_6_2023.11_30_59.PM.webm

Also here is draft PR. If we are ok with that behavior I can begin recording tomorrow!

@mollfpr
Copy link
Contributor

mollfpr commented Sep 7, 2023

The OP only put MacOS / Chrome / Safari, so that should be okay, but on the other hand, we should get similar results across the platform.

@daordonez11 Could you check if it's an easy fix for you to get the same result on all platforms?

@daordonez11
Copy link
Contributor

For sure! @mollfpr I'm about to go to sleep but tomorrow I can try a poc with the dismissModal using the targetReportID param and check if it does work on mobile. And see what happens if someone "invents" a report id same as you did when you tested my original proposal.

@daordonez11
Copy link
Contributor

NVM had to try 😂 @mollfpr that does work actually:

Poc.dismiss.with.id.-.9_6_2023.11_56_57.PM.webm

cc @francoisl

@mollfpr
Copy link
Contributor

mollfpr commented Sep 7, 2023

Looks good to me! Please, go to sleep @daordonez11 🤣

@daordonez11
Copy link
Contributor

PR updated! Will finish testing tomorrow so it can be reviewed. Thanks for the help @mollfpr

@dhanashree-sawant
Copy link

Hi @mollfpr, the issue was raised on 25 August but melvin bot has provided me with 50$ offer. Can you check that once you are available?

@mollfpr
Copy link
Contributor

mollfpr commented Sep 7, 2023

@sonialiap Could you help with @dhanashree-sawant problem? Thanks!

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Sep 8, 2023
@daordonez11
Copy link
Contributor

Recordings and PR ready for review! @mollfpr

@melvin-bot
Copy link

melvin-bot bot commented Sep 11, 2023

🎯 ⚡️ Woah @mollfpr / @daordonez11, great job pushing this forwards! ⚡️

The pull request got merged within 3 working days of assignment, so this job is eligible for a 50% #urgency bonus 🎉

  • when @daordonez11 got assigned: 2023-09-06 22:40:22 Z
  • when the PR got merged: 2023-09-11 18:23:42 UTC

On to the next one 🚀

@sonialiap
Copy link
Contributor

sonialiap commented Sep 12, 2023

Confirming that @dhanashree-sawant should receive $250 for reporting this because the issue was raised before the pay scale change

I have sent an updated offer of $250. I will complete payment once this issue is ready for payment

image

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Sep 13, 2023
@melvin-bot melvin-bot bot changed the title [$1000] Removing edit from URL of request money report description edit make the description page as task description [HOLD for payment 2023-09-20] [$1000] Removing edit from URL of request money report description edit make the description page as task description Sep 13, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Sep 13, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 13, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Sep 13, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.68-17 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 2023-09-20. 🎊

After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.

  • External issue reporter
  • Contributor that fixed the issue
  • Contributor+ that helped on the issue and/or PR

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

As a reminder, here are the bonuses/penalties that should be applied for any External issue:

  • Merged PR within 3 business days of assignment - 50% bonus
  • Merged PR more than 9 business days after assignment - 50% penalty

@melvin-bot
Copy link

melvin-bot bot commented Sep 13, 2023

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:

  • [@mollfpr] The PR that introduced the bug has been identified. Link to the PR:
  • [@mollfpr] 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:
  • [@mollfpr] 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:
  • [@mollfpr] Determine if we should create a regression test for this bug.
  • [@mollfpr] 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.
  • [@sonialiap] 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 Sep 19, 2023
@mollfpr
Copy link
Contributor

mollfpr commented Sep 19, 2023

[@mollfpr] The PR that introduced the bug has been identified. Link to the PR:
[@mollfpr] 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:

No PR is causing the regression. This is an improvement we do to handle the non-task report field page open.

[@mollfpr] 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:

The regression step should be enough.

[@mollfpr] Determine if we should create a regression test for this bug.
[@mollfpr] 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.

All

  1. Create an IOU report or use an existing one so you have a URL like: https://staging.new.expensify.com/r/{requestReportID}
  2. The edit description of a request report is: https://staging.new.expensify.com/r/{requestReportID}/edit/description, and for a task report, it is https://staging.new.expensify.com/r/{taskReportID}/description since you have a request report the second should not work

Web-mWeb

  1. In a browser input the URL https://staging.new.expensify.com/r/{requestReportID}/description you should be sent to https://staging.new.expensify.com/r/{requestReportID} since this URL only applies for task reports.
  2. Repeat step 3 for the title and description. They should only work for task reports, in the request report, the user should be redirected to the request report page

Native (iOS/Android)

  1. Send a mail or a link to the device with deep link including this 3 cases: https://staging.new.expensify.com/r/{requestReportID}/{description/title/assignee}
  2. The application should open directly on the request report page. These 3 URL only apply to task reports.

@mollfpr
Copy link
Contributor

mollfpr commented Sep 22, 2023

Friendly bump @sonialiap

@sonialiap
Copy link
Contributor

@daordonez11 fix + bonus = $1500 - paid ✔️
@mollfpr review + bonus = $1500 - paid ✔️
@dhanashree-sawant $250 - paid ✔️

Merge time calculation
Sep 8 10:05 review requested
Sep 10 11:27 review completed. Merge was delayed by internal engineer so bonus applies

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

9 participants