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 #20373][$1000] Web - Nothing happens when clicking 'mark as unread' for first message in Task page #22059

Closed
1 of 6 tasks
kbecciv opened this issue Jul 2, 2023 · 24 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. 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 Weekly KSv2

Comments

@kbecciv
Copy link

kbecciv commented Jul 2, 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. Create a Task
  2. Click on 'Mark as Done' button
  3. Go to the reaction menu on the "Completed task" message and Click on 'Mark as unread'

Expected Result:

New line marker should appear

Actual Result:

New line marker don't appear.

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.35-5
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

Test47_Markasunread-1.mp4
Recording.3369.mp4

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

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~016a6e191233b5d7c1
  • Upwork Job ID: 1676693735101640704
  • Last Price Increase: 2023-07-19
@kbecciv kbecciv added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Jul 2, 2023
@esh-g
Copy link
Contributor

esh-g commented Jul 2, 2023

Proposal

Please re-state the problem

Nothing happens when clicking 'mark as unread' for first message in Task page after clicking 'mark as done'.

What is the root cause of that problem?

When we click on mark as done, a reportAction indicating it as done, gets created and gets added to the report. Here in the completeTask function:

{
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${taskReportID}`,
value: {[completedTaskReportAction.reportActionID]: completedTaskReportAction},
},
];

But fields like lastVisibleActionCreated of the report donot get updated to reflect this reportAction being added to the report. We only update stateNum and statusNum:

value: {
stateNum: CONST.REPORT.STATE_NUM.SUBMITTED,
statusNum: CONST.REPORT.STATUS.APPROVED,

But the function ReportUtils.isUnread (which is used to check if a report is unread) depends on lastVisibleActionCreated which is still not updated in the report.

What changes do you think we should make to solve this problem?

We should also update other properties of the report while adding the reportAction like we do in Task.createTaskAndNavigate function.

const optimisticAssigneeReport = {
lastVisibleActionCreated: currentTime,
lastMessageText: lastAssigneeCommentText,
lastActorEmail: currentUserEmail,
lastActorAccountID: currentUserAccountID,
lastReadTime: currentTime,
};

This can be done with the following code:

function completeTask(taskReportID, taskTitle) {
    const message = `completed task: ${taskTitle}`;
    const completedTaskReportAction = ReportUtils.buildOptimisticTaskReportAction(taskReportID, CONST.REPORT.ACTIONS.TYPE.TASKCOMPLETED, message);

    const lastAction = completedTaskReportAction;

    const currentTime = DateUtils.getDBTime();

    const lastCommentText = ReportUtils.formatReportLastMessageText(lastAction.message[0].text);

    const optimisticReport = {
        lastVisibleActionCreated: currentTime,
        lastMessageText: lastCommentText,
        lastMessageHtml: lastCommentText,
        lastReadTime: currentTime,
        lastActorEmail: currentUserEmail,
        lastActorAccountID: currentUserAccountID,
        stateNum: CONST.REPORT.STATE_NUM.SUBMITTED,
        statusNum: CONST.REPORT.STATUS.APPROVED,
    };

    const optimisticData = [
        {
            onyxMethod: Onyx.METHOD.MERGE,
            key: `${ONYXKEYS.COLLECTION.REPORT}${taskReportID}`,
            value: optimisticReport
        },

        {
            onyxMethod: Onyx.METHOD.MERGE,
            key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${taskReportID}`,
            value: {[completedTaskReportAction.reportActionID]: completedTaskReportAction},
        },
    ];
.....

What other approach did you explore?

None

@melvin-bot
Copy link

melvin-bot bot commented Jul 2, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jul 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

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

melvin-bot bot commented Jul 5, 2023

@adelekennedy Whoops! This issue is 2 days overdue. Let's get this updated quick!

@adelekennedy adelekennedy added the External Added to denote the issue can be worked on by a contributor label Jul 5, 2023
@melvin-bot melvin-bot bot changed the title Web - Nothing happens when clicking 'mark as unread' for first message in Task page [$1000] Web - Nothing happens when clicking 'mark as unread' for first message in Task page Jul 5, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 5, 2023

Job added to Upwork: https://www.upwork.com/jobs/~016a6e191233b5d7c1

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

melvin-bot bot commented Jul 5, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jul 5, 2023

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

@adelekennedy
Copy link

replicated - this should match how we treat other actions/messages

@melvin-bot melvin-bot bot removed the Overdue label Jul 5, 2023
@s77rt
Copy link
Contributor

s77rt commented Jul 5, 2023

@esh-g Thanks for the proposal. Your RCA makes sense. The suggestion solution looks good, in fact we are already doing something very similar in this PR #20373 so we probably have nothing to do here.

@s77rt
Copy link
Contributor

s77rt commented Jul 5, 2023

@adelekennedy Let's put this on hold for #20373

@adelekennedy adelekennedy changed the title [$1000] Web - Nothing happens when clicking 'mark as unread' for first message in Task page HOLD for #20373[$1000] Web - Nothing happens when clicking 'mark as unread' for first message in Task page Jul 6, 2023
@adelekennedy adelekennedy added Weekly KSv2 and removed Daily KSv2 labels Jul 7, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 12, 2023

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

@s77rt
Copy link
Contributor

s77rt commented Jul 12, 2023

@adelekennedy Do we need to have [HOLD] in the title? Melvin does not see this as being on hold

@melvin-bot
Copy link

melvin-bot bot commented Jul 19, 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 Jul 20, 2023
@adelekennedy adelekennedy changed the title HOLD for #20373[$1000] Web - Nothing happens when clicking 'mark as unread' for first message in Task page [HOLD for #20373][$1000] Web - Nothing happens when clicking 'mark as unread' for first message in Task page Jul 20, 2023
@adelekennedy
Copy link

you're so right!!

@melvin-bot melvin-bot bot removed the Overdue label Jul 20, 2023
@melvin-bot melvin-bot bot added the Overdue label Jul 31, 2023
@s77rt
Copy link
Contributor

s77rt commented Jul 31, 2023

Still on hold

@melvin-bot melvin-bot bot removed the Overdue label Jul 31, 2023
@melvin-bot melvin-bot bot added the Overdue label Aug 8, 2023
@adelekennedy
Copy link

holding

@melvin-bot melvin-bot bot removed the Overdue label Aug 8, 2023
@melvin-bot melvin-bot bot added the Overdue label Aug 21, 2023
@adelekennedy
Copy link

Still on hold, moving to Monthly

@s77rt
Copy link
Contributor

s77rt commented Sep 23, 2023

The PR we are holding this issue for got closed. Asked for next steps here.

@melvin-bot melvin-bot bot removed the Overdue label Sep 23, 2023
@melvin-bot melvin-bot bot added the Overdue label Oct 25, 2023
@s77rt
Copy link
Contributor

s77rt commented Oct 25, 2023

@PauloGasparSv @bondydaa From #20373 (comment). That issue was closed with not much details. Can you please help us on how we should move forward with this one?

@esh-g Can you please check if the issue is still reproducible?

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

s77rt commented Nov 27, 2023

@PauloGasparSv @bondydaa @esh-g ^

@melvin-bot melvin-bot bot removed the Overdue label Nov 27, 2023
@s77rt
Copy link
Contributor

s77rt commented Nov 27, 2023

@adelekennedy Can you please make this Weekly?

@esh-g
Copy link
Contributor

esh-g commented Nov 27, 2023

@s77rt This does not seem to be reproducible anymore..

@adelekennedy adelekennedy added Weekly KSv2 and removed Monthly KSv2 labels Nov 27, 2023
@s77rt
Copy link
Contributor

s77rt commented Nov 27, 2023

@esh-g Thank you! Looks like this was fixed by the unread marker refactor #18637

@s77rt
Copy link
Contributor

s77rt commented Nov 27, 2023

@adelekennedy We are good to close this one

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. 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 Weekly KSv2
Projects
None yet
Development

No branches or pull requests

4 participants