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

[Awaiting checklist] [$250] 'Mark Unread' button unresponsive despite green line in composer #43994

Closed
1 of 6 tasks
lanitochka17 opened this issue Jun 19, 2024 · 28 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

Comments

@lanitochka17
Copy link

lanitochka17 commented Jun 19, 2024

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Version Number: 1.4.85-6
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail: N/A
Email or phone of affected tester (no customers): abebemiherat@gmail.com
Issue reported by: Applause- Internal Team

Action Performed:

  1. Open any chat and compose a message
  2. Reply to the message
  3. Delete the original message (parent message)
  4. Navigate to the left-hand navigation (LHN), left-click, and select 'Mark unread'

Expected Result:

The 'Mark unread' button should be responsive and change to 'Mark read' if a green line appears. It should become unresponsive if no message is in the composer and no green line appears

Actual Result:

Despite a message appearing in the LHN and a green line appearing in the composer, the 'Mark unread' button becomes unresponsive

Workaround:

Unknown

Platforms:

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

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence

Bug6518238_1718792230152.Screen_Recording_2024-06-19_at_3.14.19_AM.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~011a7209db54618c37
  • Upwork Job ID: 1803567026422660932
  • Last Price Increase: 2024-06-26
  • Automatic offers:
    • bernhardoj | Contributor | 102893020
Issue OwnerCurrent Issue Owner: @fedirjh
@lanitochka17 lanitochka17 added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Jun 19, 2024
Copy link

melvin-bot bot commented Jun 19, 2024

Triggered auto assignment to @twisterdotcom (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

@lanitochka17
Copy link
Author

@twisterdotcom FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors

@lanitochka17
Copy link
Author

We think that this bug might be related to #vip-vsp

@twisterdotcom twisterdotcom added the External Added to denote the issue can be worked on by a contributor label Jun 19, 2024
Copy link

melvin-bot bot commented Jun 19, 2024

Job added to Upwork: https://www.upwork.com/jobs/~011a7209db54618c37

@melvin-bot melvin-bot bot changed the title 'Mark Unread' button unresponsive despite green line in composer [$250] 'Mark Unread' button unresponsive despite green line in composer Jun 19, 2024
@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Jun 19, 2024
Copy link

melvin-bot bot commented Jun 19, 2024

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

@daledah
Copy link
Contributor

daledah commented Jun 20, 2024

Proposal

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

Despite a message appearing in the LHN and a green line appearing in the composer, the 'Mark unread' button becomes unresponsive

What is the root cause of that problem?

We're considering the empty report is read report

App/src/libs/ReportUtils.ts

Lines 5170 to 5172 in 7561439

if (isEmptyReport(report)) {
return false;
}

If the last message is [Deleted message], lastMessageText, lastMessageTranslationKey are empty -> isEmptyReport is true

return !report.lastMessageText && !report.lastMessageTranslationKey && !lastVisibleMessage.lastMessageText && !lastVisibleMessage.lastMessageTranslationKey;

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

We should check the childVisibleActionCount along with lastMessageText, lastMessageTranslationKey

  1. In getLastVisibleMessage, return additional childVisibleActionCount: lastVisibleAction?.childVisibleActionCount
  2. In isEmptyReport, add childVisibleActionCount to

return !report.lastMessageText && !report.lastMessageTranslationKey && !lastVisibleMessage.lastMessageText && !lastVisibleMessage.lastMessageTranslationKey;

return !report.lastMessageText && !report.lastMessageTranslationKey && !lastVisibleMessage.lastMessageText && !lastVisibleMessage.lastMessageTranslationKey && !lastVisibleMessage.childVisibleActionCount;

What alternative solutions did you explore? (Optional)

NA

@bernhardoj
Copy link
Contributor

Proposal

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

The mark as unread doesn't make the LHN bold even though there is a green unread line.

What is the root cause of that problem?

The LHN will be bold if the isUnread returns true.

App/src/libs/ReportUtils.ts

Lines 5165 to 5172 in 7561439

function isUnread(report: OnyxEntry<Report>): boolean {
if (!report) {
return false;
}
if (isEmptyReport(report)) {
return false;
}

However, in our case, isEmptyReport returns true, so isUnread becomes false.

App/src/libs/ReportUtils.ts

Lines 5157 to 5162 in 7561439

function isEmptyReport(report: OnyxEntry<Report>): boolean {
if (!report) {
return true;
}
const lastVisibleMessage = ReportActionsUtils.getLastVisibleMessage(report.reportID);
return !report.lastMessageText && !report.lastMessageTranslationKey && !lastVisibleMessage.lastMessageText && !lastVisibleMessage.lastMessageTranslationKey;

The lastMessageText of a report is empty for our case, but lastVisibleMessage is also empty.

ReportActionsUtils.getLastVisibleMessage gets the last visible action and returns its message. In our case, the last visible action is the [Deleted message], but the message is empty because it's deleted.

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

Replace ReportActionsUtils.getLastVisibleMessage with ReportUtils.getLastVisibleMessage.

In ReportUtils.getLastVisibleMessage, we return [Deleted message] if it's a deleted parent action which is what we need for our case.

App/src/libs/ReportUtils.ts

Lines 2242 to 2255 in 7561439

function getLastVisibleMessage(reportID: string | undefined, actionsToMerge: ReportActions = {}): LastVisibleMessage {
const report = getReport(reportID);
const lastVisibleAction = ReportActionsUtils.getLastVisibleAction(reportID ?? '-1', actionsToMerge);
// For Chat Report with deleted parent actions, let us fetch the correct message
if (ReportActionsUtils.isDeletedParentAction(lastVisibleAction) && !isEmptyObject(report) && isChatReport(report)) {
const lastMessageText = getDeletedParentActionMessageForChatReport(lastVisibleAction);
return {
lastMessageText,
};
}
// Fetch the last visible message for report represented by reportID and based on actions to merge.
return ReportActionsUtils.getLastVisibleMessage(reportID ?? '-1', actionsToMerge);

@daledah
Copy link
Contributor

daledah commented Jun 20, 2024

Hey @bernhardoj, I see your solution is quite similar to mine. I'm new in EPSF and I spent a lot of time to investigate this issue. I checked the implementation of ReportUtils.getLastVisibleMessage, it uses ReportActionsUtils.getLastVisibleMessage along with childVisibleActionCount (same as what I propose). So I think using ReportUtils.getLastVisibleMessage is just a small improvement (I didn't notice this function). What is the chosen proposal in this case @fedirjh @twisterdotcom?

@fedirjh
Copy link
Contributor

fedirjh commented Jun 24, 2024

Thank you for the proposal, @daledah and @bernhardoj. Both proposals are good. I prefer Bernard's solution for the simplicity.

Copy link

melvin-bot bot commented Jun 26, 2024

📣 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 26, 2024
@twisterdotcom
Copy link
Contributor

Shall we get an internal engineer on this @fedirjh?

@fedirjh
Copy link
Contributor

fedirjh commented Jun 26, 2024

Oh my bad missed the tag: 🎀 👀 🎀 C+ reviewed

Let's proceed with @bernhardoj's solution

🎀 👀 🎀 C+ reviewed

@melvin-bot melvin-bot bot removed the Overdue label Jun 26, 2024
Copy link

melvin-bot bot commented Jun 26, 2024

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

@chiragsalian
Copy link
Contributor

Proposal LGTM. Feel free to create the PR @bernhardoj.

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Jun 26, 2024
Copy link

melvin-bot bot commented Jun 26, 2024

📣 @bernhardoj 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job
Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Keep in mind: Code of Conduct | Contributing 📖

@melvin-bot melvin-bot bot added Reviewing Has a PR in review and removed Daily KSv2 labels Jun 27, 2024
@melvin-bot melvin-bot bot added the Weekly KSv2 label Jun 27, 2024
@bernhardoj
Copy link
Contributor

PR is ready

cc: @fedirjh

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Jul 10, 2024
@melvin-bot melvin-bot bot changed the title [$250] 'Mark Unread' button unresponsive despite green line in composer [HOLD for payment 2024-07-17] [$250] 'Mark Unread' button unresponsive despite green line in composer Jul 10, 2024
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Jul 10, 2024
Copy link

melvin-bot bot commented Jul 10, 2024

Reviewing label has been removed, please complete the "BugZero Checklist".

Copy link

melvin-bot bot commented Jul 10, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.5-13 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2024-07-17. 🎊

For reference, here are some details about the assignees on this issue:

Copy link

melvin-bot bot commented Jul 10, 2024

BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

  • [@fedirjh] The PR that introduced the bug has been identified. Link to the PR:
  • [@fedirjh] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:
  • [@fedirjh] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:
  • [@fedirjh] Determine if we should create a regression test for this bug.
  • [@fedirjh] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
  • [@twisterdotcom] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@bernhardoj
Copy link
Contributor

I'll request in ND once payment is due.

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Weekly KSv2 labels Jul 15, 2024
@melvin-bot melvin-bot bot changed the title [HOLD for payment 2024-07-17] [$250] 'Mark Unread' button unresponsive despite green line in composer [HOLD for payment 2024-07-22] [HOLD for payment 2024-07-17] [$250] 'Mark Unread' button unresponsive despite green line in composer Jul 15, 2024
Copy link

melvin-bot bot commented Jul 15, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.6-8 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2024-07-22. 🎊

For reference, here are some details about the assignees on this issue:

  • @fedirjh requires payment through NewDot Manual Requests
  • @bernhardoj requires payment through NewDot Manual Requests (Contributor)

Copy link

melvin-bot bot commented Jul 15, 2024

BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

  • [@fedirjh] The PR that introduced the bug has been identified. Link to the PR:
  • [@fedirjh] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:
  • [@fedirjh] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:
  • [@fedirjh] Determine if we should create a regression test for this bug.
  • [@fedirjh] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
  • [@twisterdotcom] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@bernhardoj
Copy link
Contributor

The payment should be due tomorrow (07-17)

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Jul 16, 2024
@bernhardoj
Copy link
Contributor

Requested in ND.

@twisterdotcom twisterdotcom changed the title [HOLD for payment 2024-07-22] [HOLD for payment 2024-07-17] [$250] 'Mark Unread' button unresponsive despite green line in composer [HOLD for payment 2024-07-17] [$250] 'Mark Unread' button unresponsive despite green line in composer Jul 17, 2024
@twisterdotcom
Copy link
Contributor

twisterdotcom commented Jul 18, 2024

Payment Summary:

  • @fedirjh paid $250 via NewDot Manual Request
  • @bernhardoj paid $250 via NewDot Manual Request (Contributor)

Just waiting on the checklist now @fedirjh.

@twisterdotcom twisterdotcom removed the Awaiting Payment Auto-added when associated PR is deployed to production label Jul 18, 2024
@twisterdotcom twisterdotcom changed the title [HOLD for payment 2024-07-17] [$250] 'Mark Unread' button unresponsive despite green line in composer [Awaiting checklist] [$250] 'Mark Unread' button unresponsive despite green line in composer Jul 18, 2024
@JmillsExpensify
Copy link

$250 approved for @bernhardoj

@fedirjh
Copy link
Contributor

fedirjh commented Jul 22, 2024

BugZero Checklist:

@JmillsExpensify
Copy link

$250 approved for @fedirjh

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
Projects
No open projects
Archived in project
Development

No branches or pull requests

7 participants