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-11] [$1000] Chat - The chat unread status does not show unread after the user goes online #17692

Closed
2 of 6 tasks
kbecciv opened this issue Apr 19, 2023 · 95 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Engineering Internal Requires API changes or must be handled by Expensify staff Weekly KSv2

Comments

@kbecciv
Copy link

kbecciv commented Apr 19, 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. Open network tab on Account A and switch to offline mode
  2. Open a group chat and send a message on Account A
  3. Go to Account B and open the same group chat with Account A and send multiple messages
  4. Go back to Account A and open any chat other than the previous group chat
  5. Turn off offline mode
  6. Check the group chat on LHN

Expected Result:

The group chat should show unread status since there are new messages sent in the group while Account A was offline

Actual Result:

The group chat does not show unread status and when opening the group chat the new messages are visible.

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.2.2

Reproducible in staging?: Yes

Reproducible in production?: Yes

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

2023-04-19.13.55.30.mp4
Recording.2533.mp4

Expensify/Expensify Issue URL:

Issue reported by: @Nathan-Mulugeta

Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1681902462599969

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01fbfa46985f3e9ea0
  • Upwork Job ID: 1650478391345414144
  • Last Price Increase: 2023-05-01
Issue OwnerCurrent Issue Owner: @JmillsExpensify
@kbecciv kbecciv added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Apr 19, 2023
@MelvinBot
Copy link

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

@MelvinBot
Copy link

MelvinBot commented Apr 19, 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 Apr 24, 2023
@slafortune
Copy link
Contributor

Looks good!

@melvin-bot melvin-bot bot removed the Overdue label Apr 24, 2023
@slafortune slafortune added External Added to denote the issue can be worked on by a contributor Overdue labels Apr 24, 2023
@melvin-bot melvin-bot bot changed the title Chat - When a user sends a message in a group chat while offline and receives new messages in the same chat during that time, the group chat status does not show unread after the user goes online [$1000] Chat - When a user sends a message in a group chat while offline and receives new messages in the same chat during that time, the group chat status does not show unread after the user goes online Apr 24, 2023
@MelvinBot
Copy link

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

@MelvinBot
Copy link

Triggered auto assignment to @miljakljajic (External), see https://stackoverflow.com/c/expensify/questions/8582 for more details.

@MelvinBot
Copy link

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

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

Triggered auto assignment to @neil-marcellini (External), see https://stackoverflow.com/c/expensify/questions/7972 for more details.

@alitoshmatov
Copy link
Contributor

Proposal

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

When a user sends a message in a group chat while offline and receives new messages in the same chat during that time, the group chat status does not show unread after the user goes online

What is the root cause of that problem?

So basically this is what's happening:

  1. Device A(offline) sends a message, request is added into queue
  2. Device B(online) sends a message, goes to backend
  3. When device A comes online, it receives updates which include message from device B.
  4. Requests in queue in device A gets sent, backend pushes update with lastReadTime based on current request which is after device B's message

And you can see that, offline sent messages are ordered after messages that sent online

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

Well there is not much we can do about it, since based on current logic, message's created time is determined by when it is received by backend rather than when it is sent by client app and lastReadTime is updated when new message is received.

One thing we can do is, to supply lastReadTime in a AddComment request manually, and when backend receives this command it will create new messsage with current time, but updates lastReadTime with value we provided. But, this might lead to get unread for their own messages

What alternative solutions did you explore? (Optional)

@vadymdev716
Copy link

I am very happy to post my opinion on this issue. I can show more clear idea when I see your backend workflow. And now, I have a logical idea to resolve this issue with an experience when I got on previous project.
Make a notification when receive a new message from other. And implement real-time messaging to get a new message status.

@MelvinBot
Copy link

📣 @vadymtbl! 📣

Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
Please follow these steps:

  1. Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
  2. Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
  3. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.

Screen Shot 2022-11-16 at 4 42 54 PM

Format:

Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>

@MelvinBot
Copy link

✅ Contributor details stored successfully. Thank you for contributing to Expensify!

@MelvinBot
Copy link

⚠️ Invalid email. Please make sure to create an Expensify account with this email first here.

@vadymdev716
Copy link

Contributor details
Your Expensify account email: [email protected]
Upwork Profile Link: https://www.upwork.com/freelancers/~01394546b94c94ce62

@MelvinBot
Copy link

✅ Contributor details stored successfully. Thank you for contributing to Expensify!

@neil-marcellini
Copy link
Contributor

@kbecciv Wow that's quite a title 😆 would you please write a shorter one?

@kbecciv kbecciv changed the title [$1000] Chat - When a user sends a message in a group chat while offline and receives new messages in the same chat during that time, the group chat status does not show unread after the user goes online [$1000] Chat - The group chat status does not show unread after the user goes online Apr 24, 2023
@melvin-bot melvin-bot bot changed the title [$1000] Chat - The chat unread status does not show unread after the user goes online [HOLD for payment 2024-01-11] [$1000] Chat - The chat unread status does not show unread after the user goes online Jan 4, 2024
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Jan 4, 2024
Copy link

melvin-bot bot commented Jan 4, 2024

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

Copy link

melvin-bot bot commented Jan 4, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.21-4 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-01-11. 🎊

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 Jan 4, 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:

  • [@ntdiary] The PR that introduced the bug has been identified. Link to the PR:
  • [@ntdiary] 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:
  • [@ntdiary] 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:
  • [@ntdiary] Determine if we should create a regression test for this bug.
  • [@ntdiary] 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.
  • [@JmillsExpensify] 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 and removed Weekly KSv2 labels Jan 11, 2024
Copy link

melvin-bot bot commented Jan 11, 2024

Payment Summary

Upwork Job

  • ROLE: @ntdiary paid $(AMOUNT) via Upwork (LINK)

BugZero Checklist (@JmillsExpensify)

  • I have verified the correct assignees and roles are listed above and updated the neccesary manual offers
  • I have verified that there are no duplicate or incorrect contracts on Upwork for this job (https://www.upwork.com/ab/applicants/1650478391345414144/hired)
  • I have paid out the Upwork contracts or cancelled the ones that are incorrect
  • I have verified the payment summary above is correct

Copy link

melvin-bot bot commented Jan 15, 2024

@JmillsExpensify, @ntdiary, @MonilBhavsar Whoops! This issue is 2 days overdue. Let's get this updated quick!

@MonilBhavsar
Copy link
Contributor

@ntdiary could you please take a look at the checklist. I think we should add regression tests for this issue.

@melvin-bot melvin-bot bot removed the Overdue label Jan 16, 2024
@ntdiary
Copy link
Contributor

ntdiary commented Jan 16, 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:

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

Ah, @MonilBhavsar, thank you for the reminder. I have just reviewed the comments in this issue, and I feel this is a edge case that our app had not addressed rather than a bug introduced by a specific PR. So I only provide the regression steps here. Please feel free to let me know if I'm missing anything. :)

Regression steps:

  1. Prepare two users A and B, and login on two devices.
  2. As user A, open the chat with user B.
  3. Go offline and send a message.
  4. As user B on another device and being online, send two messages to user A.
  5. As user A, open another chat and then switch back online.
  6. Ensure chat with User B is marked as unread in LHN.
  7. Open the chat and ensure new marker line is about two new messages sent in step 4 from user B

@melvin-bot melvin-bot bot added the Overdue label Jan 18, 2024
Copy link

melvin-bot bot commented Jan 19, 2024

@JmillsExpensify, @ntdiary, @MonilBhavsar Whoops! This issue is 2 days overdue. Let's get this updated quick!

@MonilBhavsar
Copy link
Contributor

Bumping to weekly as we're awaiting payment here cc @JmillsExpensify

@MonilBhavsar MonilBhavsar added Weekly KSv2 and removed Daily KSv2 labels Jan 22, 2024
@MonilBhavsar
Copy link
Contributor

Already bumped, Melvin

@JmillsExpensify
Copy link

Apologies ya'll. I was OOO and just getting back. Jumping in now to close the loop.

@JmillsExpensify
Copy link

JmillsExpensify commented Jan 22, 2024

Payment summary: $1,000 to @ntdiary for proposal management and C+ testing/review. $250 to @Nathan-Mulugeta for reporting.

@melvin-bot melvin-bot bot removed the Overdue label Jan 22, 2024
@JmillsExpensify
Copy link

Regression test created and offer sent to @ntdiary, so please let me know when you've accepted and I can make the payment. Thank you!

@Nathan-Mulugeta
Copy link

Nathan-Mulugeta commented Jan 22, 2024

Hey @JmillsExpensify, I think You forgot reporting bonus. 😁

@JmillsExpensify
Copy link

Ah yes, I did. Sorry about that!

@ntdiary
Copy link
Contributor

ntdiary commented Jan 23, 2024

Regression test created and offer sent to @ntdiary, so please let me know when you've accepted and I can make the payment. Thank you!

@JmillsExpensify, just woke up, and have accepted it. Thank you! ☀️😄

@Nathan-Mulugeta
Copy link

I too accepted the offer.

@JmillsExpensify
Copy link

All contracts paid out. Closing this issue.

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. Engineering Internal Requires API changes or must be handled by Expensify staff Weekly KSv2
Projects
None yet
Development

No branches or pull requests