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 payment 2024-01-17] [$500] Threads - When deleting the last unread message, the "New" marker appears for a second #31637

Closed
6 tasks done
kbecciv opened this issue Nov 21, 2023 · 30 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production 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

@kbecciv
Copy link

kbecciv commented Nov 21, 2023

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Version Number: 1.4.1.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
Expensify/Expensify Issue URL:
Issue reported by: Applause - Internal Team
Slack conversation:

Action Performed:

  1. Open a chat
  2. Send two messages
  3. Click on "Mark as unread" on the first message
  4. Delete the messages one by one

Expected Result:

The new marker disappears with no delay

Actual Result:

The new marker disappears after a delay

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

Bug6285667_1700579957504.test5_newMarker.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01e466a8c7c7ded031
  • Upwork Job ID: 1726989610491375616
  • Last Price Increase: 2023-12-04
  • Automatic offers:
    • s-alves10 | Contributor | 27964548
@kbecciv kbecciv added External Added to denote the issue can be worked on by a contributor Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Nov 21, 2023
@melvin-bot melvin-bot bot changed the title Threads - When deleting the last unread message, the "New" marker appears for a second [$500] Threads - When deleting the last unread message, the "New" marker appears for a second Nov 21, 2023
Copy link

melvin-bot bot commented Nov 21, 2023

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

Copy link

melvin-bot bot commented Nov 21, 2023

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

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

melvin-bot bot commented Nov 21, 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

Copy link

melvin-bot bot commented Nov 21, 2023

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

@kbecciv
Copy link
Author

kbecciv commented Nov 21, 2023

This issue fixed here: #21557.

@paultsimura
Copy link
Contributor

paultsimura commented Nov 21, 2023

Proposal

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

Having multiple unread messages, and removing all of them, the unread line disappears with delay.

What is the root cause of that problem?

We update the unread marker of the last report action only after the action is actually deleted – when the API response comes. But the action gets hidden right after the API call was initiated – when it has reportAction.pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE.

Therefore, the marker is briefly visible under the "invisible" last removed action while the API request is running.

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

We should hide the marker not when the action delete API call was completed, but at the moment it was initiated.

For this, in the shouldDisplayNewMarker function, where we check whether the report action should have the unread marker displayed, we should also return false if the reportAction has pending DELETE action. We also want to check for the network state so that we display the line correctly when offline – because then the messages are not removed, just greyed out:

if (!isOffline && reportAction.pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE) {
    return false;
}

const shouldDisplayNewMarker = useCallback(
(reportAction, index) => {
let shouldDisplay = false;
if (!currentUnreadMarker) {
const nextMessage = sortedReportActions[index + 1];
const isCurrentMessageUnread = isMessageUnread(reportAction, lastReadTimeRef.current);
shouldDisplay = isCurrentMessageUnread && (!nextMessage || !isMessageUnread(nextMessage, lastReadTimeRef.current));
if (!messageManuallyMarkedUnread) {
shouldDisplay = shouldDisplay && reportAction.actorAccountID !== Report.getCurrentUserAccountID();
}
if (shouldDisplay) {
cacheUnreadMarkers.set(report.reportID, reportAction.reportActionID);
}
} else {
shouldDisplay = reportAction.reportActionID === currentUnreadMarker;
}
return shouldDisplay;
},
[currentUnreadMarker, sortedReportActions, report.reportID, messageManuallyMarkedUnread],
);

Result:

unread-indicator-compressed.mp4

What alternative solutions did you explore? (Optional)

@s-alves10
Copy link
Contributor

This issue was addressed here #30485 (comment)
I think the suggested solution would solve the issue

@MonilBhavsar MonilBhavsar self-assigned this Nov 21, 2023
@MonilBhavsar
Copy link
Contributor

Self assigning as it is related to marker

@MonilBhavsar
Copy link
Contributor

Dupe of #25606

@zanyrenney
Copy link
Contributor

Closing as this is a dupe!

@MonilBhavsar
Copy link
Contributor

Reopening this issue as another issue was closed and there are some proposals and discussion here

@MonilBhavsar MonilBhavsar reopened this Dec 4, 2023
Copy link

melvin-bot bot commented Dec 4, 2023

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

@MonilBhavsar
Copy link
Contributor

@ArekChr any thoughts on the proposals from paultsimura and s-alves10 in another PR

@ArekChr
Copy link
Contributor

ArekChr commented Dec 5, 2023

As previously discussed, we agreed to address this issue in a separate PR. I've reviewed the solution provided by @s-alves10 in PR #30485 and it solves the bug. Given that @s-alves10 has already developed a working fix, I think we should go ahead with this approach.

🎀 👀 🎀 C+ reviewed

Copy link

melvin-bot bot commented Dec 5, 2023

Current assignee @MonilBhavsar is eligible for the choreEngineerContributorManagement assigner, not assigning anyone new.

@MonilBhavsar
Copy link
Contributor

MonilBhavsar commented Dec 5, 2023

Thanks! Looks good, since we're updating ReportActionsUtils.ts, let's make sure we don't add any regression.

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Dec 5, 2023
@melvin-bot melvin-bot bot changed the title [$500] Threads - When deleting the last unread message, the "New" marker appears for a second [HOLD for payment 2023-12-26] [$500] Threads - When deleting the last unread message, the "New" marker appears for a second Dec 19, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Dec 19, 2023
Copy link

melvin-bot bot commented Dec 19, 2023

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

Copy link

melvin-bot bot commented Dec 19, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.13-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 2023-12-26. 🎊

After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.

  • External issue reporter
  • Contributor that fixed the issue
  • Contributor+ that helped on the issue and/or PR

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

Copy link

melvin-bot bot commented Dec 19, 2023

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:

  • [@MonilBhavsar] The PR that introduced the bug has been identified. Link to the PR:
  • [@MonilBhavsar] 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:
  • [@MonilBhavsar] 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:
  • [@ArekChr / @s-alves10] Determine if we should create a regression test for this bug.
  • [@ArekChr / @s-alves10] 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.
  • [@zanyrenney] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@melvin-bot melvin-bot bot added Daily KSv2 Overdue and removed Weekly KSv2 labels Dec 25, 2023
@MonilBhavsar
Copy link
Contributor

This has caused regression. We're working on a fix

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Dec 28, 2023
Copy link

melvin-bot bot commented Jan 2, 2024

@ArekChr, @MonilBhavsar, @zanyrenney, @s-alves10 Eep! 4 days overdue now. Issues have feelings too...

@MonilBhavsar
Copy link
Contributor

PR is in review

@zanyrenney
Copy link
Contributor

Not paying out yet due to regression.

@melvin-bot melvin-bot bot added the Overdue label Jan 8, 2024
@zanyrenney
Copy link
Contributor

@MonilBhavsar can you let me know when the regression is resolved for payout please?

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Jan 8, 2024
@MonilBhavsar
Copy link
Contributor

PR is deployed to production yesterday. I'll add seven days and update the title

@melvin-bot melvin-bot bot removed the Overdue label Jan 11, 2024
@MonilBhavsar MonilBhavsar changed the title [HOLD for payment 2023-12-26] [$500] Threads - When deleting the last unread message, the "New" marker appears for a second [HOLD for payment 2024-01-17] [$500] Threads - When deleting the last unread message, the "New" marker appears for a second Jan 11, 2024
@zanyrenney
Copy link
Contributor

not overdue yet, waiting for regression 7 day period.

@melvin-bot melvin-bot bot removed the Overdue label Jan 15, 2024
@zanyrenney
Copy link
Contributor

*Payment summary

@ArekChr does not require payment (Contractor)
@s-alves10 requires payment automatic offer (Contributor) - PAID $500.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production 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
None yet
Development

No branches or pull requests

6 participants