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-04-03] HIGH: [Reliability] [$500] Unread fevicon does not show for new messages / unread messages #38256

Closed
1 of 6 tasks
m-natarajan opened this issue Mar 13, 2024 · 39 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Weekly KSv2

Comments

@m-natarajan
Copy link

m-natarajan commented Mar 13, 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.51-3
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: @AndrewGable
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1710193817230399

Action Performed:

  1. Sign in to a account as user A
  2. Sign in to another account in another device as B
  3. Send a message from B to A

Expected Result:

Fevicon should display unread icon

Actual Result:

Does not show

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

Recording.2850.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~011928bada81510714
  • Upwork Job ID: 1768019508229373952
  • Last Price Increase: 2024-03-13
  • Automatic offers:
    • situchan | Reviewer | 0
    • gijoe0295 | Contributor | 0
@m-natarajan m-natarajan added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Mar 13, 2024
Copy link

melvin-bot bot commented Mar 13, 2024

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

@gijoe0295
Copy link
Contributor

gijoe0295 commented Mar 13, 2024

Proposal

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

Unread fevicon does not show for new messages / unread messages.

What is the root cause of that problem?

This is about module importing in JS. In UnreadIndicatorUpdater, we used export default to export function:

export default function getUnreadReportsForUnreadIndicator(reports: OnyxCollection<Report>, currentReportID: string) {

When we used import UnreadIndicatorUpdater from './libs/UnreadIndicatorUpdater' in Expensify.tsx, it only imported the exported function, not executed the top-level code in the module including Onyx.connect:

import UnreadIndicatorUpdater from './libs/UnreadIndicatorUpdater';

This has happened since we migrated Expensify to TS.

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

We should use import './libs/UnreadIndicatorUpdater' just like we did here:

import './libs/Notification/PushNotification/subscribePushNotification';

What alternative solutions did you explore? (Optional)

NA

@situchan
Copy link
Contributor

@garrettmknight garrettmknight added the External Added to denote the issue can be worked on by a contributor label Mar 13, 2024
@melvin-bot melvin-bot bot changed the title Unread fevicon does not show for new messages / unread messages [$500] Unread fevicon does not show for new messages / unread messages Mar 13, 2024
Copy link

melvin-bot bot commented Mar 13, 2024

Job added to Upwork: https://www.upwork.com/jobs/~011928bada81510714

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Mar 13, 2024
Copy link

melvin-bot bot commented Mar 13, 2024

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

@askavyblr
Copy link

Proposal

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

Unread favicon does not show for new messages

What is the root cause of that problem?

We need to update unreadReports and sync

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

const unreadReports = getUnreadReportsForUnreadIndicator(allReports, currentReportID);

What alternative solutions did you explore? (Optional)

N/A

@jeremy-croff
Copy link
Contributor

jeremy-croff commented Mar 14, 2024

Proposal

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

The favicon for unread is missing! Great catch btw

What is the root cause of that problem?

This is a regression from the typescript migration: #25231
There is functional difference between this and javascript. Changing to the previous javascript file mitigates this issue.

I believe this is a case of "Side effect imports" to understand the issue in depth.
Typescript has to be configured in order to preserve unused side effects, but without that, it will clean it up unused imports as an optimization. This is different from JS.

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

I agree with the previous post that we should import everything with import './libs/UnreadIndicatorUpdater' in the Expensify.tsx file to execute all the side effects. I just wanted to mention the Root Cause Analysis (RCA) and link the regression. We can also eliminate the lint exclusions // eslint-disable-next-line @typescript-eslint/no-unused-vars.

Confirmed this solution with the docs from https://www.typescriptlang.org/docs/handbook/2/modules.html

What alternative solutions did you explore? (Optional)

@Santhosh-Sellavel
Copy link
Collaborator

Santhosh-Sellavel commented Mar 14, 2024

I'd like to review this as C+ since I have context while reviewing similar issues:

@garrettmknight Please assign @situchan as C+ here, I'll unassign myself here.

@Santhosh-Sellavel Santhosh-Sellavel removed their assignment Mar 14, 2024
@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Mar 14, 2024
Copy link

melvin-bot bot commented Mar 14, 2024

❌ There was an error making the offer to @situchan for the Contributor role. The BZ member will need to manually hire the contributor.

@situchan
Copy link
Contributor

Thanks

@situchan
Copy link
Contributor

Thanks for the proposals.

While @jeremy-croff's root cause is more accurate, I think it's not fair for @gijoe0295 to ignore their efforts to find offending PR and solution first. Pointing out the offending PR itself mostly covers the root cause.
That being said, I recommend to assign @gijoe0295.
Proposal: #38256 (comment)

@jeremy-croff please feel free to comment with the reason if you disagree.
Assigned engineer will give the final call.
🎀 👀 🎀 C+ reviewed

Copy link

melvin-bot bot commented Mar 14, 2024

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

@jeremy-croff
Copy link
Contributor

Thanks for the proposals.

While @jeremy-croff's root cause is more accurate, I think it's not fair for @gijoe0295 to ignore their efforts to find offending PR and solution first. Pointing out the offending PR itself mostly covers the root cause. That being said, I recommend to assign @gijoe0295. Proposal: #38256 (comment)

@jeremy-croff please feel free to comment with the reason if you disagree. Assigned engineer will give the final call. 🎀 👀 🎀 C+ reviewed

I know this situation is a bit complicated because I also feel bad for suggesting the same solution. The only improvement I could find was to remove the unnecessary lint rule.

However, based on your explanation, I would like to clarify a few things. Firstly, I was the one who identified the problematic PR and linked it to TypeScript migration, not @gijoe0295. Secondly, it appears that @gijoe0295 only edited the PR to indicate that the issue was caused by TypeScript migration after the fact."er I posted this root cause

@situchan
Copy link
Contributor

However, based on your explanation, I would like to clarify a few things. Firstly, I was the one who identified the problematic PR and linked it to TypeScript migration, not @gijoe0295. Secondly, it appears that @gijoe0295 only edited the PR to indicate that the issue was caused by TypeScript migration after the fact."er I posted this root cause

As we know the offending line, the PR could have been identified in a few seconds using git bisect or git lens

Screenshot 2024-03-15 at 1 29 09 AM

@gijoe0295
Copy link
Contributor

I was the one who identified the problematic PR and linked it to TypeScript migration

@jeremy-croff I think you might be mistaken here. I edited my proposal to point to TS migration before you did. And we all know which PR it is without explicitly link the PR 😄.

@jeremy-croff
Copy link
Contributor

@situchan I see what you mean.

His root cause states specifically it's a wrong import, and that's it.But that import hadn't changed in over a year and that is why I wanted to point out the real root cause. He then posted he posted 3 lines of code all with different git history. For example it could've been the default export that occured during writing of the unit test of 8c3c4e2 also 2 months ago. since the import never changed right.

When I wrote my proposal I thought it would provide the actual clarity. As it brought in the specifics and the history the bug. Not leave you to assume based on your own usage of gitlens on 1 of the refererred lines of code.

But now I also see that @gijoe0295 edited his proposal to mention typescript, but I don't have the granular timestamp to know where it was me or him that posted it first. As both were 16 hours ago.
@gijoe0295 Maybe we found it at the same time, but the only reason I posted was because you missed this at first and I knew I could add value even if I don't actually do the work and you do 👍

@situchan
Copy link
Contributor

@gijoe0295 updated proposal 25min before @jeremy-croff's post

@jeremy-croff
Copy link
Contributor

@gijoe0295 I hope you understand where I came from, I drafted the proposal for far over 25 minutes so I was not trying to duplicate your proposal. I actually did not know you edited to add typescript before my post so my statement of me pointing it out first was genuine, but a misunderstanding.

Thanks for all the clarifications and @situchan there's no disagreement from me.

@situchan
Copy link
Contributor

PR reached staging

@quinthar quinthar changed the title [$500] Unread fevicon does not show for new messages / unread messages [$500] [Reliability] Unread fevicon does not show for new messages / unread messages Mar 25, 2024
@quinthar quinthar changed the title [$500] [Reliability] Unread fevicon does not show for new messages / unread messages HIGH: [Reliability] [$500] Unread fevicon does not show for new messages / unread messages Mar 25, 2024
@garrettmknight garrettmknight added Awaiting Payment Auto-added when associated PR is deployed to production and removed Reviewing Has a PR in review labels Mar 27, 2024
@garrettmknight
Copy link
Contributor

On prod, updating for payment

@garrettmknight garrettmknight changed the title HIGH: [Reliability] [$500] Unread fevicon does not show for new messages / unread messages [HOLD for payment 2024-04-03] HIGH: [Reliability] [$500] Unread fevicon does not show for new messages / unread messages Mar 27, 2024
@gijoe0295
Copy link
Contributor

@garrettmknight Payment due ytd.

@garrettmknight
Copy link
Contributor

All paid out.

@situchan can you post the bug zero checklist when you get a chance?

@melvin-bot melvin-bot bot added the Overdue label Apr 15, 2024
@deetergp
Copy link
Contributor

Bump @situchan

@melvin-bot melvin-bot bot removed the Overdue label Apr 15, 2024
@melvin-bot melvin-bot bot added the Overdue label Apr 23, 2024
@deetergp
Copy link
Contributor

@situchan can you post the bug zero checklist when you get a chance?

Another friendly bump, @situchan

@melvin-bot melvin-bot bot removed the Overdue label Apr 24, 2024
@garrettmknight
Copy link
Contributor

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:

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

@melvin-bot melvin-bot bot added the Overdue label May 2, 2024
@garrettmknight
Copy link
Contributor

@situchan bumpity bump

@melvin-bot melvin-bot bot removed the Overdue label May 3, 2024
@melvin-bot melvin-bot bot added the Overdue label May 13, 2024
@garrettmknight
Copy link
Contributor

@situchan bump - please complete the checklist.

@melvin-bot melvin-bot bot removed the Overdue label May 13, 2024
@melvin-bot melvin-bot bot added the Overdue label May 21, 2024
@deetergp
Copy link
Contributor

@situchan Bump! Please finish the checklist. Thanks!

@melvin-bot melvin-bot bot removed the Overdue label May 21, 2024
@situchan
Copy link
Contributor

Sorry I am back from vacay

@situchan
Copy link
Contributor

Regression Test Proposal

  1. Login to any account with several unread chats
  2. [Web] Verify that browser's tab favicon shows unread status and tab title shows unread count
  3. [iOS/Desktop] Verify that app's icon shows unread status

@deetergp
Copy link
Contributor

Thanks @situchan and welcome back 🎉

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. External Added to denote the issue can be worked on by a contributor Weekly KSv2
Projects
No open projects
Development

No branches or pull requests

9 participants