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

[$1000] The text "Chat report" is temporarily displayed in the Task title position #20063

Closed
1 of 6 tasks
kavimuru opened this issue Jun 2, 2023 · 24 comments
Closed
1 of 6 tasks
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

@kavimuru
Copy link

kavimuru commented Jun 2, 2023

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 a chat
  2. Go to "Assign Task" section
  3. Enter the task title and click on the "Next" button
  4. Click on "Assignee" and select a user
  5. Click on "Confirm task"

Expected Result:

The text "Chat report" should not be displayed in the Task title position

Actual Result:

After creating a task, the text "Chat report" is temporarily displayed in the Task title position

Workaround:

Can the user still use Expensify without this being fixed? Have you informed them of the workaround?

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.22
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

2023-05-27.01-52-36.mp4
Recording.847.mp4

Expensify/Expensify Issue URL:
Issue reported by: @ayazhussain79
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1685134842254209

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~018549030b7de49763
  • Upwork Job ID: 1664669801894019072
  • Last Price Increase: 2023-06-16
@kavimuru kavimuru added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Jun 2, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jun 2, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jun 2, 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

@flaviadefaria flaviadefaria added the External Added to denote the issue can be worked on by a contributor label Jun 2, 2023
@melvin-bot melvin-bot bot changed the title The text "Chat report" is temporarily displayed in the Task title position [$1000] The text "Chat report" is temporarily displayed in the Task title position Jun 2, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jun 2, 2023

Job added to Upwork: https://www.upwork.com/jobs/~018549030b7de49763

@melvin-bot
Copy link

melvin-bot bot commented Jun 2, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jun 2, 2023

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

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

melvin-bot bot commented Jun 2, 2023

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

@alitoshmatov
Copy link
Contributor

Proposal

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

The text "Chat report" is temporarily displayed in the Task title position

What is the root cause of that problem?

I think there are two issues here

  1. In ReportScreen component fetchReportIfNeeded is not preventing unnecessary call for api

    fetchReportIfNeeded() {
    const reportIDFromPath = getReportID(this.props.route);
    // Report ID will be empty when the reports collection is empty.
    // This could happen when we are loading the collection for the first time after logging in.
    if (!reportIDFromPath) {
    return;
    }
    // It possible that we may not have the report object yet in Onyx yet e.g. we navigated to a URL for an accessible report that
    // is not stored locally yet. If props.report.reportID exists, then the report has been stored locally and nothing more needs to be done.
    // If it doesn't exist, then we fetch the report from the API.
    if (this.props.report.reportID && this.props.report.reportID === getReportID(this.props.route)) {
    return;
    }
    Report.openReport(reportIDFromPath);
    }

    this is because this.props.report.reportID is not the same as getReportID(this.props.route) for a short time, thus resulting on calling Report.openReport function

  2. This is weird, and I am not sure why it is happening. When we call Report.openReport lodashGet(allReports, [reportID]) is not able to find existing report based on reportID Even if it exists, I logged everything in the console and made sure I am not hallucinating. It is happening just one time when we create task report.

    reportName: lodashGet(allReports, [reportID, 'reportName'], CONST.REPORT.DEFAULT_REPORT_NAME),

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

We should remove this.props.report.reportID === getReportID(this.props.route) from here

if (this.props.report.reportID && this.props.report.reportID === getReportID(this.props.route)) {

Since we might have reportID which indicates we have report data locally but reportID and id in route may not match

What alternative solutions did you explore? (Optional)

@kushu7
Copy link
Contributor

kushu7 commented Jun 2, 2023

Proposal

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

The text "Chat report" is temporarily displayed in the Task title position.

What is the root cause of that problem?

We are creating a new task and navigating to report page. problem is that optimisticData data doesn't get set to onyx within time-frame i guess. each time i got report undefined after navigating to report after creating task.

API.write(
'CreateTask',
{
parentReportActionID,
parentReportID: finalParentReportID,
taskReportID,
name,
description,
assignee,
assigneeChatReportID,
},
{optimisticData, successData, failureData},
);
// Navigate to the newly created task
Navigation.navigate(ROUTES.getReportRoute(optimisticTaskReport.reportID));

We get report undefined in that case. we use fallback REPORT.DEFAULT_REPORT_NAME as title.
https://github.com/Expensify/App/blob/65d9ceb6f5fd6d8b02b8ddc7a5071768d7dbe1c9/src/libs/actions/Report.js#LL327C15-L327C15

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

We can solve it by using Onyx Callback or setTimeout of 10ms while navigating to report page. it will solve our problem.

Navigation.navigate(ROUTES.getReportRoute(optimisticTaskReport.reportID));

we can move this into onyx callback.

const connectionId = Onyx.connect({
        key: `${ONYXKEYS.COLLECTION.REPORT}${optimisticTaskReport.reportID}`,
        waitForCollectionCallback: true,
        callback: () => {
            Onyx.disconnect(connectionId);
            Navigation.navigate(ROUTES.getReportRoute(optimisticTaskReport.reportID));
        }
    });

or we can move this into setTimeout.

setTimeout(()=>{
       Navigation.navigate(ROUTES.getReportRoute(optimisticTaskReport.reportID));
   },10)

I prefer onyx collection callback over setTImeout.
It will not create any performance issue.

Video
Screen.Recording.2023-06-03.at.1.10.56.AM.mov

What alternative solutions did you explore? (Optional)

None

@melvin-bot
Copy link

melvin-bot bot commented Jun 2, 2023

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.

@MrJithil
Copy link

MrJithil commented Jun 4, 2023

Proposal

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

While user create a new task, the Chat Report title showing as the task title for short time.

What is the root cause of that problem?

The openReport function calling lodashGet with a default value of CONST.REPORT.DEFAULT_REPORT_NAME which is Chat Report to create optimisticReportData.

Once the Create Task api calls completed, the new data will be updated.

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

Some small modification to the openReport action of Report.js.

If we can modify the openReport as below to accept the reportName, this problem will be solved. We need to pass the taskName as reportName while creating a task.

function openReport(reportID, ...., reportName = CONST.REPORT.DEFAULT_REPORT_NAME) {

Since we are setting the CONST.REPORT.DEFAULT_REPORT_NAME to the reportName as a default value, it will not break the existing functionality.

Please note, if needed, we can wrap the params of openReport in an object openReportParams and de-structure it if there is a concerns of adding more params .

What alternative solutions did you explore? (Optional)

@melvin-bot melvin-bot bot added the Overdue label Jun 5, 2023
@flaviadefaria
Copy link
Contributor

@mananjadhav any thoughts on the proposals above?

@melvin-bot melvin-bot bot removed the Overdue label Jun 5, 2023
@mananjadhav
Copy link
Collaborator

Please allow me a day to review. I am unwell and would be offline most of the day.

@melvin-bot
Copy link

melvin-bot bot commented Jun 9, 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 Jun 9, 2023
@mananjadhav
Copy link
Collaborator

Reviewing the proposals. I need to verify the condition once, and then will decide which proposal to use.

We definitely don’t want to use setTimeout, and I am sure removing the reportId === condition could cause regressions.

@melvin-bot melvin-bot bot removed the Overdue label Jun 9, 2023
@mananjadhav
Copy link
Collaborator

@kavimuru @techievivek Are you folks able to reproduce this? I haven't been able to reproduce this. Infact I get some other error (probably because I am not added to BETAS).

Screen.Recording.2023-06-09.at.11.31.04.PM.mov

@melvin-bot melvin-bot bot added the Overdue label Jun 12, 2023
@MrJithil
Copy link

@mananjadhav I just investigated this case on my local machine again, I was also not able to reproduce it. While comparing to the proposal I made against the current source code, I can see thi issue has been fixed by the PR #20335

So, this is not an issue anymore.

The other issue you mentioned is a different case. I guess, there are tickets opened for fixing the over height already in many places. Not sure completely.

@melvin-bot
Copy link

melvin-bot bot commented Jun 12, 2023

@mananjadhav, @techievivek, @flaviadefaria Whoops! This issue is 2 days overdue. Let's get this updated quick!

@melvin-bot
Copy link

melvin-bot bot commented Jun 14, 2023

@mananjadhav, @techievivek, @flaviadefaria Eep! 4 days overdue now. Issues have feelings too...

@mananjadhav
Copy link
Collaborator

@kavimuru @techievivek did you get a chance to look at this comment?

@melvin-bot melvin-bot bot removed the Overdue label Jun 14, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jun 16, 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
Copy link

melvin-bot bot commented Jun 16, 2023

@mananjadhav @techievivek @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 melvin-bot bot added the Overdue label Jun 16, 2023
@techievivek
Copy link
Contributor

@mananjadhav

@kavimuru @techievivek did you get a chance to look at this #20063 (comment)?

Taking a look, sorry I missed the ping.

@melvin-bot melvin-bot bot removed the Overdue label Jun 19, 2023
@techievivek
Copy link
Contributor

I am unable to reproduce this, @kavimuru Can you please try reproducing this?

@flaviadefaria
Copy link
Contributor

It seems like this has been fixed as mentioned here so let's go ahead and close this.

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