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] Task - The "Chat Report" briefly displays when the receiver clicks on a sent task before loading the task details and returns to the chat #29036

Closed
4 of 6 tasks
m-natarajan opened this issue Oct 6, 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

@m-natarajan
Copy link

m-natarajan commented Oct 6, 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. Log in to User A's account
  2. Open User B's chat
  3. Go to the "Assign task" section
  4. Create a task by entering a title
  5. Open another browser and log in to User B's account
  6. Click on the sent task for details and then click on User A’s chat before the task details have fully loaded

Expected Result:

Chat report should not be displayed when the receiver clicks on a sent task before loading the task details and returns back to the chat

Actual Result:

The chat report briefly appears when the receiver clicks on the sent task before the task details have fully loaded and then returns back to the chat

Workaround:

unknown

Platforms:

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

  • Android / native - emulator not working for the contributor
  • Android / Chrome
  • iOS / native
  • iOS / Safari
  • MacOS / Chrome / Safari
  • MacOS / Desktop

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

Screen.Recording.2023-10-06.at.11.55.37.PM.mov
20231006235310.mp4
Screen.Recording.2023-10-06.at.11.43.56.PM.mov
screen-recording-2023-10-06-at-112140-pm_ZiruaoqJ.mp4
Recording.14.mp4

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

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~012bf63c7fac0f0222
  • Upwork Job ID: 1710393474434949120
  • Last Price Increase: 2023-10-17
@m-natarajan m-natarajan added the External Added to denote the issue can be worked on by a contributor label Oct 6, 2023
@melvin-bot melvin-bot bot changed the title Task - The "Chat Report" briefly displays when the receiver clicks on a sent task before loading the task details and returns to the chat [$500] Task - The "Chat Report" briefly displays when the receiver clicks on a sent task before loading the task details and returns to the chat Oct 6, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 6, 2023

Job added to Upwork: https://www.upwork.com/jobs/~012bf63c7fac0f0222

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

melvin-bot bot commented Oct 6, 2023

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

@melvin-bot melvin-bot bot added the Daily KSv2 label Oct 6, 2023
@zukilover
Copy link
Contributor

zukilover commented Oct 6, 2023

Proposal

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

The "Chat Report" briefly displays when the receiver clicks on a sent task before loading the task details and returns to the chat

What is the root cause of that problem?

TaskPreview is trying to use the default reportName from its optimistic data when the detail is still being loaded.

: props.action.childStateNum === CONST.REPORT.STATE_NUM.SUBMITTED && props.action.childStatusNum === CONST.REPORT.STATUS.APPROVED;
const taskTitle = props.taskReport.reportName || props.action.childReportName;

When detail is loading, the taskTitle is rendering from this data:

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

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

Prefer to use childReportName from action first, since that information is already available to the user.

Change this line:

const taskTitle = props.taskReport.reportName || props.action.childReportName;

to:

const taskTitle = props.action.childReportName || props.taskReport.reportName;

What alternative solutions did you explore? (Optional)

N/A

@abhikam395
Copy link

abhikam395 commented Oct 6, 2023

It reads value from reportName variable inside value object as reportName sometimes is actual task name and sometimes its just "Chat Report"

{
"onyxData": [
{
"onyxMethod": "merge",
"key": "report_7496678832565117",
"value": {
"reportID": "7496678832565117",
"reportName": "Chat Report",
"type": "chat",
"chatType": "",
"ownerEmail": "fake",
"ownerAccountID": 0,
"managerEmail": "fake",
"managerID": 0,
"policyID": "FAKE",
"participantAccountIDs": [
15842262
],
"isPinned": false,
"lastReadTime": "2023-10-06 23:27:12.388",
"lastMentionedTime": null,
"lastReadSequenceNumber": 0,
"lastVisibleActionCreated": "2023-10-06 23:27:11.726",
"lastVisibleActionLastModified": "2023-10-06 23:27:11.726",
"lastMessageText": "task for sadf asdf asdf asdf asdf asdf asdf asdf",
"lastActorAccountID": 15842262,
"notificationPreference": "always",
"welcomeMessage": "",
"stateNum": 0,
"statusNum": 0,
"oldPolicyName": "",
"visibility": null,
"isOwnPolicyExpenseChat": false,
"lastMessageHtml": "task for sadf asdf asdf asdf asdf asdf asdf asdf",
"iouReportID": null,
"hasOutstandingIOU": false,
"policyName": null,
"hasParentAccess": null,
"parentReportID": null,
"parentReportActionID": null,
"writeCapability": "all",
"description": null,
"isDeletedParentAction": null,
"total": 0,
"currency": "USD",
"submitterPayPalMeAddress": "",
"chatReportID": null,
"isWaitingOnBankAccount": false
}
},

    `

{
"onyxData": [
{
"onyxMethod": "merge",
"key": "report_1265709252388942",
"value": {
"reportID": "1265709252388942",
"reportName": "sadf asdf asdf asdf asdf asdf asdf asdf",
"type": "task",
"chatType": "",
"ownerEmail": "abhikam395@gmail.com",
"ownerAccountID": 15842262,
"managerEmail": "fake",
"managerID": 0,
"policyID": "FAKE",
"participantAccountIDs": [
15842276
],
"isPinned": false,
"lastReadTime": null,
"lastMentionedTime": null,
"lastReadSequenceNumber": 0,
"lastVisibleActionCreated": "2023-10-06 23:27:11.725",
"lastVisibleActionLastModified": "2023-10-06 23:27:11.725",
"lastMessageText": "",
"lastActorAccountID": 15842262,
"notificationPreference": "hidden",
"welcomeMessage": "",
"stateNum": 0,
"statusNum": 0,
"oldPolicyName": "",
"visibility": null,
"isOwnPolicyExpenseChat": false,
"lastMessageHtml": "",
"iouReportID": null,
"hasOutstandingIOU": false,
"policyName": null,
"hasParentAccess": true,
"parentReportID": "7496678832565117",
"parentReportActionID": "5483285656688644440",
"writeCapability": "all",
"description": "f asdfasdf asdf asdf asdf asdf asdf asdf dfchildReportNamesad fasdf asdf asdf asdf adsf",
"isDeletedParentAction": null,
"total": 0,
"currency": "USD",
"submitterPayPalMeAddress": "",
"chatReportID": "7496678832565117",
"isWaitingOnBankAccount": false
}
},
{
"onyxMethod": "merge",
"key": "report_1265709252388942",
"value": {
"lastReadTime": null
}
},
{
"onyxMethod": "merge",
"key": "reportActions_1265709252388942",
"value": {
"5038936398546252359": {
"reportActionID": "5038936398546252359",
"previousReportActionID": "0",
"actionName": "CREATED",
"created": "2023-10-06 23:27:11.725",
"reportActionTimestamp": 1696634831725,
"avatar": "https://d2k5nsl2zxldvw.cloudfront.net/images/avatars/default-avatar_6.png",
"message": [
{
"type": "TEXT",
"style": "strong",
"text": "abhikam395@gmail.com"
},
{
"type": "TEXT",
"style": "normal",
"text": " created this report"
}
],
"person": [
{
"type": "TEXT",
"style": "strong",
"text": "abhikam395@gmail.com"
}
],
"automatic": false,
"sequenceNumber": 0,
"shouldShow": true,
"lastModified": "2023-10-06 23:27:11.725"
}
}
},
{
"onyxMethod": "merge",
"key": "personalDetailsList",
"value": {
"15842276": {
"accountID": 15842276,
"avatar": "https://d2k5nsl2zxldvw.cloudfront.net/images/avatars/default-avatar_20.png",
"displayName": "abhikam593@gmail.com",
"firstName": "",
"lastName": "",
"status": null,
"login": "abhikam593@gmail.com",
"pronouns": "",
"timezone": {
"automatic": true,
"selected": "Asia/Calcutta"
},
"payPalMeAddress": "",
"phoneNumber": "",
"validated": true
}
}
},
{
"onyxMethod": "merge",
"key": "reportActions_7496678832565117",
"value": {
"5483285656688644440": {
"person": [
{
"type": "TEXT",
"style": "strong",
"text": "abhikam395@gmail.com"
}
],
"actorAccountID": 15842262,
"message": [
{
"type": "COMMENT",
"html": "task for sadf asdf asdf asdf asdf asdf asdf asdf",
"text": "task for sadf asdf asdf asdf asdf asdf asdf asdf",
"isEdited": false,
"whisperedTo": [],
"isDeletedParentAction": false,
"reactions": []
}
],
"originalMessage": {
"html": "task for sadf asdf asdf asdf asdf asdf asdf asdf",
"lastModified": "2023-10-06 23:27:11.726",
"taskReportID": 1265709252388942
},
"avatar": "https://d2k5nsl2zxldvw.cloudfront.net/images/avatars/default-avatar_6.png",
"created": "2023-10-06 23:27:11.726",
"timestamp": 1696634831,
"reportActionTimestamp": 1696634831726,
"automatic": false,
"actionName": "ADDCOMMENT",
"shouldShow": true,
"reportActionID": "5483285656688644440",
"previousReportActionID": "8530328364200430390",
"lastModified": "2023-10-06 23:27:11.726",
"childReportID": 1265709252388942,
"childType": "task",
"childReportName": "sadf asdf asdf asdf asdf asdf asdf asdf",
"whisperedToAccountIDs": []
}
}
},
{
"onyxMethod": "merge",
"key": "report_1265709252388942",
"value": {
"lastReadTime": null
}
}
],
"jsonCode": 200,
"requestID": "8121acc0f8ac072f-DEL"
}
`

@melvin-bot
Copy link

melvin-bot bot commented Oct 6, 2023

📣 @abhikam395! 📣
Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
Please follow these steps:

  1. Make sure you've read and understood the contributing guidelines.
  2. Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
  3. Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
  4. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
    Screen Shot 2022-11-16 at 4 42 54 PM
    Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>

@paultsimura
Copy link
Contributor

paultsimura commented Oct 6, 2023

Proposal

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

When a tack recipient opens the task report, its name is set to "Chat Report" for a moment.

What is the root cause of that problem?

In the TaskPreview component, we are building the taskTitle this way:

const taskTitle = props.taskReport.reportName || props.action.childReportName;

It should take props.action.childReportName if the props.taskReport.reportName is absent.

However, when the recipient opens the task report, we send an OpenReport API command, and in it we set the default report name "Chat Report" optimistically:

{
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.REPORT}${reportID}`,
value: reportActionsExist(reportID)
? {}
: {
reportName: lodashGet(allReports, [reportID, 'reportName'], CONST.REPORT.DEFAULT_REPORT_NAME),
},
},

So when the user opens the report, the props.taskReport.reportName is already present, but it has value "Chat Report".

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

We should rely not only on the taskReport.reportName being present, but it also having a reportID, which will mean that the report is loaded.

We can even make this check a separate variable and use it above as well:

-   const isTaskCompleted = !_.isEmpty(props.taskReport)
+   const isTaskReportReady = lodashHas(props.taskReport, 'reportID');
+   const isTaskCompleted = isTaskReportReady
        ? props.taskReport.stateNum === CONST.REPORT.STATE_NUM.SUBMITTED && props.taskReport.statusNum === CONST.REPORT.STATUS.APPROVED
        : props.action.childStateNum === CONST.REPORT.STATE_NUM.SUBMITTED && props.action.childStatusNum === CONST.REPORT.STATUS.APPROVED;

-   const taskTitle = props.taskReport.reportName || props.action.childReportName;
+   const taskTitle = isTaskReportReady ? props.taskReport.reportName : props.action.childReportName;

What alternative solutions did you explore? (Optional)

@Victor-Nyagudi
Copy link
Contributor

Victor-Nyagudi commented Oct 7, 2023

Possible similar root cause as #24460

@ayazhussain79
Copy link
Contributor

This #24460 bug is not reproducible

@Victor-Nyagudi
Copy link
Contributor

Edited.

@melvin-bot
Copy link

melvin-bot bot commented Oct 10, 2023

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

@melvin-bot melvin-bot bot added the Overdue label Oct 10, 2023
@m-natarajan m-natarajan added the Bug Something is broken. Auto assigns a BugZero manager. label Oct 10, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 10, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Oct 10, 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

@joekaufmanexpensify
Copy link
Contributor

Not overdue. I will triage today

@melvin-bot melvin-bot bot removed the Overdue label Oct 10, 2023
@joekaufmanexpensify
Copy link
Contributor

I can't reproduce this on my end. The skeleton UI isn't used when I try to click into a task, so there is no chance to click the task, and then click the parent chat in LHN before the task loads.

2023-10-10_16-32-53.mp4

@joekaufmanexpensify
Copy link
Contributor

I'm not sure it really makes sense to do anything here if this isn't consistently reproducible. Going to close this for now.

@situchan
Copy link
Contributor

@joekaufmanexpensify that's because report data is already cached locally. Can you try again after logout and re-login?

@paultsimura
Copy link
Contributor

@joekaufmanexpensify I've just reproduced it in prod. It's not inconsistent – all you should do is just test on slow internet (you can mimic it on the Network tab, similar to going offline).

Also, make sure that you share the task with user B, but don't assign it to them. Just for the experiment's clarity.

slow.task.-.chat.report.mov

@joekaufmanexpensify
Copy link
Contributor

Got it. I will try both of those and see if I can reproduce.

@melvin-bot
Copy link

melvin-bot bot commented Oct 17, 2023

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

@joekaufmanexpensify
Copy link
Contributor

I still can't consistently reproduce this, even after trying right after signing in, and throttling my network requests to slow 3G.

2023-10-18_17-07-21.mp4

@joekaufmanexpensify
Copy link
Contributor

Even if this was consistently reproducible though, I'm not sure this would warrant doing anything. Since it seems like right after the report data is cached locally, this doesn't happen.

Which would mean someone would need to have either just signed in/have bad network connection, and then click into a task and quickly try and click the parent chat before the task loads. Which doesn't really seem like a super user action, unless someone is trying to test this.

@joekaufmanexpensify
Copy link
Contributor

Closing for now!

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

8 participants