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

Task shows "no activity yet" in LHS with activities. #25937

Closed
1 of 6 tasks
m-natarajan opened this issue Aug 25, 2023 · 47 comments
Closed
1 of 6 tasks

Task shows "no activity yet" in LHS with activities. #25937

m-natarajan opened this issue Aug 25, 2023 · 47 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Engineering Internal Requires API changes or must be handled by Expensify staff Monthly KSv2

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 contributors@expensify.com to request to join our Slack channel!


Action Performed:

  1. Open acc A & B
  2. Create a task from acc A and assign to any user (except B)
  3. Add some messages to task report from account A
  4. Assign it to account B
  5. Observe last message of task in LHS

Expected Result:

The task report should show the latest message in the LHS.

Actual Result:

The task report shows no activity yet in the LHS.

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

bug_demo.2.mp4
Recording.397.mp4

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

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01a929c2ede7994053
  • Upwork Job ID: 1696219199991738368
  • Last Price Increase: 2023-09-04
@m-natarajan m-natarajan added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Aug 25, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 25, 2023

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

@melvin-bot melvin-bot bot added the Overdue label Aug 28, 2023
@isabelastisser isabelastisser added the External Added to denote the issue can be worked on by a contributor label Aug 28, 2023
@melvin-bot melvin-bot bot changed the title Task shows "no activity yet" in LHS with activities. [$1000] Task shows "no activity yet" in LHS with activities. Aug 28, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 28, 2023

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

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

melvin-bot bot commented Aug 28, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Aug 28, 2023

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

@isabelastisser
Copy link
Contributor

Not overdue, applied the external label.

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

Proposal

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

When assigning a new assignee to a task, the task report shows "No Activity Yet" on the LHS of all participants, even though there may be chat messages on the task.
Actually, it seems that this happens for every type of task edit, not just assignee change. (for example editing the title has the same effect).

What is the root cause of that problem?

It seems to me that the php server (who's code I don't think I have access to) wrongfully changes the "lastMessageText" attribute of the report to an empty string when the EditTaskAssignee API call is made.

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

Change the server code so that it does not remove the lastMessageText when a task is edited.

What alternative solutions did you explore? (Optional)

Alternatively, we could add another else if clause here in line 391 that would check if the last report action was an edit action and if so, display the last visible report action which is already found in line 378:

function getLastMessageTextForReport(report) {
const lastReportAction = _.find(
allSortedReportActions[report.reportID],
(reportAction, key) => ReportActionUtils.shouldReportActionBeVisible(reportAction, key) && reportAction.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE,
);
let lastMessageTextFromReport = '';
if (ReportUtils.isReportMessageAttachment({text: report.lastMessageText, html: report.lastMessageHtml, translationKey: report.lastMessageTranslationKey})) {
lastMessageTextFromReport = `[${Localize.translateLocal(report.lastMessageTranslationKey || 'common.attachment')}]`;
} else if (ReportActionUtils.isReportPreviewAction(lastReportAction)) {
const iouReport = ReportUtils.getReport(ReportActionUtils.getIOUReportIDFromReportActionPreview(lastReportAction));
lastMessageTextFromReport = ReportUtils.getReportPreviewMessage(iouReport, lastReportAction);
} else if (ReportActionUtils.isModifiedExpenseAction(lastReportAction)) {
lastMessageTextFromReport = ReportUtils.getModifiedExpenseMessage(lastReportAction);
} else {
lastMessageTextFromReport = report ? report.lastMessageText || '' : '';

@melvin-bot
Copy link

melvin-bot bot commented Aug 29, 2023

📣 @tomgilon! 📣
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. 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.
  2. 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.
  3. 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>

@tomgilon
Copy link

Contributor details
Your Expensify account email: tomgilon@gmail.com
Upwork Profile Link: https://www.upwork.com/freelancers/~013c894068f3f8cf4b

@melvin-bot
Copy link

melvin-bot bot commented Aug 29, 2023

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

@DylanDylann
Copy link
Contributor

I think it is a BE bug. The BE should return reportActions of task report to new assignee

@tomgilon
Copy link

Adding for clarification to #25937 (comment) :
note that the reopening of a task and the completion of task use different API calls and so are not affected by this bug, as can be seen in the reporter's videos

@isabelastisser
Copy link
Contributor

Hey @rushatgabhane, can you please review @tomgilon proposal above? Thanks!

@redpanda-bit
Copy link
Contributor

We don't see the correct preview because we use reportActions to craft the correct message, and 0 reportActions come in when the task arrives at account B. This is also why the message is fixed once we navigate to the task – this causes the reportActions to be fetched and in turn the correct message to be created.

We should:
a) send the latest reportAction when changing the task assignee -RECOMMENDED, the 2nd report related to the task (the other chat) gets updated like this.
or
b) send latestMessageText when changing assignee.

Both approaches require BE changes and might only need BE changes actually.

@tomgilon
Copy link

tomgilon commented Aug 29, 2023

ok, so there are actually two problems here

  1. like @carlosalmonte04 and @DylanDylann say the backend doesn't return the reportAction until we navigate to the task
  2. like I said in my original comment, report.lastMessageText is empty. And this is the property which is generally used to craft the LHS message. The only reason reopened task message appears correctly once you've navigated is because it has special treatment here in line 310:
    if ((result.isChatRoom || result.isPolicyExpenseChat || result.isThread || result.isTaskReport) && !result.isArchivedRoom) {
    const lastAction = visibleReportActionItems[report.reportID];
    if (lodashGet(lastAction, 'actionName', '') === CONST.REPORT.ACTIONS.TYPE.RENAMED) {
    const newName = lodashGet(lastAction, 'originalMessage.newName', '');
    result.alternateText = Localize.translate(preferredLocale, 'newRoomPage.roomRenamedTo', {newName});
    } else if (lodashGet(lastAction, 'actionName', '') === CONST.REPORT.ACTIONS.TYPE.TASKREOPENED) {
    result.alternateText = `${Localize.translate(preferredLocale, 'task.messages.reopened')}: ${report.reportName}`;
    } else if (lodashGet(lastAction, 'actionName', '') === CONST.REPORT.ACTIONS.TYPE.TASKCOMPLETED) {
    result.alternateText = `${Localize.translate(preferredLocale, 'task.messages.completed')}: ${report.reportName}`;
    } else {
    result.alternateText = lastMessageTextFromReport.length > 0 ? lastMessageText : Localize.translate(preferredLocale, 'report.noActivityYet');
    }

    As you can see (line 314), for other types of messages (like regular messages), the problem persists and "No Activity Yet" continues to be displayed even after navigating to the task.
    Video showing the problem:
    https://github.com/Expensify/App/assets/13032054/dc5b5108-be2e-4ed6-8f4f-abe6b562400d

Seems that fixing number 2 will solve number 1 as well. But if we choose to fix number 1, then we also have to fix number 2, or add a conditional that will manually take the correct message (see #25937 (comment))

@isabelastisser
Copy link
Contributor

Hey @rushatgabhane, what are the next steps here?

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

melvin-bot bot commented Sep 4, 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 Sep 5, 2023

@rushatgabhane, @isabelastisser Huh... This is 4 days overdue. Who can take care of this?

@isabelastisser
Copy link
Contributor

Bump @rushatgabhane

@melvin-bot melvin-bot bot removed the Overdue label Sep 5, 2023
@isabelastisser
Copy link
Contributor

Bump @grgia. Are we working on this?

@melvin-bot melvin-bot bot removed the Overdue label Oct 16, 2023
@melvin-bot melvin-bot bot added the Overdue label Oct 25, 2023
@isabelastisser
Copy link
Contributor

Hey @grgia are we working on this? Should we close this?

@melvin-bot melvin-bot bot removed the Overdue label Oct 25, 2023
@melvin-bot melvin-bot bot added the Overdue label Nov 3, 2023
@isabelastisser
Copy link
Contributor

@grgia are you working on this?

@melvin-bot melvin-bot bot removed the Overdue label Nov 3, 2023
@melvin-bot melvin-bot bot added the Overdue label Nov 13, 2023
@grgia
Copy link
Contributor

grgia commented Nov 13, 2023

Whoops this got lost in my K2 sorry @isabelastisser !

@melvin-bot melvin-bot bot removed the Overdue label Nov 13, 2023
@grgia grgia added Monthly KSv2 and removed Weekly KSv2 labels Nov 13, 2023
@grgia
Copy link
Contributor

grgia commented Nov 13, 2023

Making monthly for now

@melvin-bot melvin-bot bot added the Overdue label Dec 15, 2023
@isabelastisser
Copy link
Contributor

isabelastisser commented Dec 15, 2023

@grgia, should we change this to Daily, given our urgency and roadmap? Does this bug need to be fixed before EOY? Is it a critical issue?

@melvin-bot melvin-bot bot removed the Overdue label Dec 15, 2023
@melvin-bot melvin-bot bot added the Overdue label Jan 15, 2024
@isabelastisser
Copy link
Contributor

Bump @grgia

@isabelastisser
Copy link
Contributor

@grgia I DM'd you for an update. Thanks!

@melvin-bot melvin-bot bot removed the Overdue label Feb 16, 2024
@melvin-bot melvin-bot bot added the Overdue label Mar 18, 2024
@isabelastisser
Copy link
Contributor

I DM'd @grgia again now.

@melvin-bot melvin-bot bot removed the Overdue label Mar 18, 2024
@grgia grgia closed this as completed Apr 3, 2024
@grgia
Copy link
Contributor

grgia commented Apr 3, 2024

I think we can just close this out for now @isabelastisser

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. Engineering Internal Requires API changes or must be handled by Expensify staff Monthly KSv2
Projects
No open projects
Status: CRITICAL
Development

No branches or pull requests

7 participants