Expensify / App

Welcome to New Expensify: a complete re-imagination of financial collaboration, centered around chat. Help us build the next generation of Expensify by sharing feedback and contributing to the code.
https://new.expensify.com
MIT License
3.51k stars 2.86k forks source link

The chat is not showing Unread messages when replied to a chat via email #43777

Closed m-natarajan closed 3 months ago

m-natarajan commented 4 months ago

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: v1.4.83-2 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: @VictoriaExpensify Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1718319503018869

Action Performed:

  1. Go to staging.new.expensify.com
  2. Initiate a DM to B
  3. As B reply by email

    Expected Result:

    The reply displayed as unread message in LHN

    Actual Result:

    The reply not displayed in LHN

    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
    • [X] MacOS: Desktop

Screenshots/Videos

https://github.com/Expensify/App/assets/38435837/3a791359-811e-46f5-a430-c8226c9f9ca2

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0190fc8ada72fd4d14
  • Upwork Job ID: 1801758222363871252
  • Last Price Increase: 2024-06-26
Issue OwnerCurrent Issue Owner: @
melvin-bot[bot] commented 4 months ago

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

melvin-bot[bot] commented 4 months ago

Job added to Upwork: https://www.upwork.com/jobs/~0190fc8ada72fd4d14

melvin-bot[bot] commented 4 months ago

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

mallenexpensify commented 4 months ago

@thesahindia was testing cuz Internal wasn't assigning a C+ for some reason

MelvinBot commented 4 months ago

This has been labelled "Needs Reproduction". Follow the steps here: https://stackoverflowteams.com/c/expensify/questions/16989

mallenexpensify commented 4 months ago

Trying to test, awaiting email from test user. @thesahindia , can you also try to test? In case you're able to before me.

thesahindia commented 4 months ago

It is reproducible!

mallenexpensify commented 4 months ago

How do you get the email to send to you? I tried multiple times yesterday and checked that notifications were set to immediate.

Do you think this can be worked on externally @thesahindia ?

thesahindia commented 4 months ago

Yesterday, when I sent the message, I received the email within a few minutes. However, when I tried today, the email took a few hours to arrive. I didn't do anything specific

I think this can be external.

melvin-bot[bot] commented 4 months ago

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

mallenexpensify commented 4 months ago

Thanks @thesahindia , marked External, I checked a couple times today, never got the email/s for some reason.

melvin-bot[bot] commented 4 months ago

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

mallenexpensify commented 4 months ago

Checking on internally https://expensify.slack.com/archives/C01SKUP7QR0/p1719001928198269?thread_ts=1719001866.214179&cid=C01SKUP7QR0

melvin-bot[bot] commented 4 months ago

@mallenexpensify, @thesahindia Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

melvin-bot[bot] commented 4 months ago

Upwork job price has been updated to $500

mallenexpensify commented 4 months ago

Bumped to $500 to get some eyes. Also trying to reproduce again with sending messages to two accounts so I can reply.

jp928 commented 4 months ago

This seems like a BE problem. I could see the message in the payload if reload the App.

jp928 commented 4 months ago

Proposal

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

The chat is not showing Unread messages when replied to a chat via email

What is the root cause of that problem?

Websocket doesn't send the onyx message to update.

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

Send the message to FE with following format

  "onyxMethod": "merge",
            "key": "reportActions_",

What alternative solutions did you explore? (Optional)

NA

thesahindia commented 4 months ago

This seems like a BE problem. I could see the message in the payload if reload the App.

Thanks for letting us know. @mallenexpensify, let's get someone from the internal team.

mallenexpensify commented 4 months ago

Checking in #expensify-open-source about here

The chat is not showing Unread messages when replied to a chat via email appears to need to be backend. It seems important to fix but it's in #vip-vsb which is on hold. Please comment if you have feedback or if an internal engineer is willing to take it on.

melvin-bot[bot] commented 4 months ago

@mallenexpensify @thesahindia this issue was created 2 weeks ago. Are we close to a solution? Let's make sure we're treating this as a top priority. Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

melvin-bot[bot] commented 4 months ago

@mallenexpensify, @thesahindia Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

mallenexpensify commented 4 months ago

Checking in #engineering-chat (thought it was #engineering when I posted :ohnohthing) https://expensify.slack.com/archives/C03TQ48KC/p1719964100569379

techievivek commented 4 months ago

I looked into the backend code and it seems we are intentionally marking the message as read. I wanted to confirm this behavior. If a user has replied via email, they have seen the message sent by the other user, correct? In this case, do we still need to show the message as unread in the LHN?

mallenexpensify commented 4 months ago

Yeah, from the steps in OP, I think so (I tried to reproduce multiple times without luck though).

Steps

Expected Result: The reply displayed as unread message in LHN

so.. user A sends message to B, B replies via email, chat is not showing bold for user A.
This would mean there's no other way for user A to have seen the message from user B, right?

techievivek commented 3 months ago

Investigating this, here is a request logs https://www.expensify.com/_devportal/tools/logSearch/?#query=request_id:(%228a015512ad7ec58a-SEA%22)+AND+timestamp:[2024-07-08T15:08:19.672Z+TO+2024-07-08T17:08:19.672Z]&index=logs_expensify-029291, it is using the addComment command so unsure why we are not queuing updates for the receiver.

techievivek commented 3 months ago
Screenshot 2024-07-11 at 8 15 36 PM

We are queuing onyx update for the report but this is not getting pushed to the receiver.

techievivek commented 3 months ago

I am unable to reproduce this issue locally. I tried mimicking the process of sending a response via email, and the comment was added to the chat in real-time. I will check if I can reproduce this on the production or staging environment and might ask for a retest. This functionality is expected to work correctly since we are using the same method that the NewDot client uses when users respond to a chat, so everything should be the same.

techievivek commented 3 months ago

Ok, finally figured out the root cause here. Since replying through email is a different flow we need to ensure we create a createSendFetchableJob to push the updates to the receiver here https://github.com/Expensify/Web-Expensify/blob/fe0db5837a4825162ea4b3a79901a25748191a3f/lib/Mailgun/API.php#L1505

melvin-bot[bot] commented 3 months ago

@mallenexpensify, @techievivek, @thesahindia Whoops! This issue is 2 days overdue. Let's get this updated quick!

techievivek commented 3 months ago

This was fixed internally here: https://github.com/Expensify/Web-Expensify/pull/42742, so I am going to close this out now.