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

[$500] Web - Any change in description/title/assignee URL opens task report in place of 'Hmm its not here' page #27143

Closed
6 tasks
kbecciv opened this issue Sep 11, 2023 · 22 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors

Comments

@kbecciv
Copy link

kbecciv commented Sep 11, 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. Open any report with open task in it
  3. Open title/description/assignee and make small modification to the URL
  4. Observe that it displays task report with that URL

Expected Result:

App should either redirect us back to task report URL or display Hmm its not here page to ensure that user understands their mistake in URL

Actual Result:

App displays task report with same URL in browser when there is slight modification to description/title/assignee page URL

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.66.3
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
Notes/Photos/Videos: Any additional supporting documentation

redirects.back.to.main.task.page.on.wrong.URL.mp4
Recording.4331.mp4

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

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01aab6a37e55af6c15
  • Upwork Job ID: 1701219809901121536
  • Last Price Increase: 2023-09-18
@kbecciv kbecciv 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 Sep 11, 2023
@melvin-bot melvin-bot bot changed the title Web - Any change in description/title/assignee URL opens task report in place of 'Hmm its not here' page [$500] Web - Any change in description/title/assignee URL opens task report in place of 'Hmm its not here' page Sep 11, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 11, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Sep 11, 2023

Triggered auto assignment to @greg-schroeder (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 Sep 11, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 11, 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

@melvin-bot
Copy link

melvin-bot bot commented Sep 11, 2023

Triggered auto assignment to @JmillsExpensify (External), see https://stackoverflow.com/c/expensify/questions/8582 for more details.

@melvin-bot
Copy link

melvin-bot bot commented Sep 11, 2023

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

@EliteDevSolution
Copy link

EliteDevSolution commented Sep 11, 2023

Hello Expensify Team
I think that it will be solve such as bottom code.

import React, { Component } from 'react';

class TaskReportScreen extends Component {
  constructor(props) {
    super(props);

    this.state = {
      isValidURL: true
    };
  }

  componentDidMount() {
    this.validateURL(this.props.route.params.taskID);
  }

  validateURL(taskID) {
    // Add your validation logic here (e.g., check if taskID exists in the database)
    // Set isValidURL to true if valid, false if not
    const isValid = this.props.validateURL(taskID); // Assuming validateURL is a prop function
    this.setState({ isValidURL: isValid });
  }

  handleGoBack = () => {
    this.props.navigation.goBack();
  };

  render() {
    const { isValidURL } = this.state;

    return (
      <div>
        {isValidURL ? (
          <div>
            {/* Render task report details */}
            <div>Task Report Details</div>
            <button onClick={this.handleModifyTask}>Modify Task</button>
          </div>
        ) : (
          <div>
            <div>Hmm, it's not here</div>
            <button onClick={this.handleGoBack}>Go Back</button>
          </div>
        )}
      </div>
    );
  }
}

export default TaskReportScreen;

Sure, I can help you convert the provided functional component into a class component. Here's the equivalent class component:
The constructor is used to initialize the component's state, where isValidURL is set to true initially.
I use componentDidMount to trigger the URL validation when the component mounts.
validateURL is a method that you should define, similar to the one in the functional component. It checks if the taskID is valid and updates isValidURL accordingly.
The handleGoBack method is an arrow function to ensure that this refers to the class instance when it's called.
In the render method, we use this.state.isValidURL to conditionally render the task report details or the error message.

@b4s36t4
Copy link
Contributor

b4s36t4 commented Sep 11, 2023

Proposal

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

Web - Any change in description/title/assignee URL opens task report in place of 'Hmm its not here' page

What is the root cause of that problem?

The issue is that we have centeral navigator registered for reportActionID parameter as well.

So when we navigate to r/5160821586502398/assigneeaassa assigneeaassa is becoming reportActionID which won't raise any error since navigation this it's a route.

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

Well, I'm not sure what to do.

Maybe it's that I don't that many messages (I have 2 messages) I don't copy message link option in context menu or we haven't fully implemented the navigating ot reportActionID part yet.

If we haven't implemented it yet fully I suggest we remove reportActionID? param from route until we have full screens/logic on every page written for it.

if we have implemented the feature fully, maybe someone can help me find it how to enable navigaiton using reportActionID

What alternative solutions did you explore? (Optional)

NA

Caused because of PR from issue #23711

@rushatgabhane @JmillsExpensify can you guys specify the expected behaviour here for the whole RCA, instead of just solving this issue.

@Tyrese-FullStackGenius
Copy link

Contributor details
Your Expensify account email: [email protected]
Upwork Profile Link: https://www.upwork.com/freelancers/~019904ef989290e55b

When redirecting to another page, save the path to the previous page and if the page does not exist, it redirects to the previous page.

@melvin-bot
Copy link

melvin-bot bot commented Sep 11, 2023

✅ Contributor details stored successfully. Thank you for contributing to Expensify!

@rushatgabhane
Copy link
Member

I'm not sure if there's an issue here. I think we should do nothing

@b4s36t4
Copy link
Contributor

b4s36t4 commented Sep 12, 2023

But shouldn't we show NotFoundPage if they're navigating to invalid route?

@greg-schroeder
Copy link
Contributor

@JmillsExpensify looks like we were double assigned (reason here) - I was assigned first though so I'll take this

@rushatgabhane
Copy link
Member

rushatgabhane commented Sep 12, 2023

It's not a big deal imo. We're navigating to the correct report at least
Let's do nothing?

@b4s36t4
Copy link
Contributor

b4s36t4 commented Sep 12, 2023

Well, in my view atleast we should update the URL. It's not an ideal behaviour a user can do.. but atleast we should update the URL making sure he is in the correct page. If we don't do anything that means the action user did is correct which is not good.

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

melvin-bot bot commented Sep 18, 2023

@greg-schroeder, @rushatgabhane Eep! 4 days overdue now. Issues have feelings too...

@greg-schroeder
Copy link
Contributor

what do you think about that comment @rushatgabhane ☝️ ?

@melvin-bot melvin-bot bot removed the Overdue label Sep 18, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 18, 2023

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

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

melvin-bot bot commented Sep 22, 2023

@greg-schroeder, @rushatgabhane Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@greg-schroeder
Copy link
Contributor

Bump @rushatgabhane

@melvin-bot melvin-bot bot removed the Overdue label Sep 25, 2023
@rushatgabhane
Copy link
Member

@greg-schroeder i think we should do nothing

@b4s36t4
Copy link
Contributor

b4s36t4 commented Sep 25, 2023

Can we get some opinions from slack, let's take other's view as well.

@greg-schroeder
Copy link
Contributor

Hmm. I think I trust @rushatgabhane's judgment.

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. Daily KSv2 External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors
Projects
None yet
Development

No branches or pull requests

7 participants