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

[$1000] No new marker if tab opened via link to the specific chat #12598

Closed
kavimuru opened this issue Nov 9, 2022 · 93 comments
Closed

[$1000] No new marker if tab opened via link to the specific chat #12598

kavimuru opened this issue Nov 9, 2022 · 93 comments
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 Help Wanted Apply this label when an issue is open to proposals by contributors

Comments

@kavimuru
Copy link

kavimuru commented Nov 9, 2022

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


Issue was found when executing #12169

Action Performed:

  1. Open two sessions one as User A and one as User B
  2. Make sure User B is navigate to the chat with User A and save the URL
  3. Close User B tab (or kill app)
  4. Create message as User A on chat with User B and wait 10 seconds
  5. Open tab (or app) as User B using the URL saved from the second step (on native use a deep link)
  6. See that new marker is set correctly
  7. Verify that the chat in the LHN is marked as read

Expected Result:

new marker is set correctly

Actual Result:

there is no new marker

Workaround:

unknown

Platform:

Where is this issue occurring?

  • Web
  • iOS
  • Android
  • Desktop App - could not test as it requires copying URL

Version Number: 1.2.25-0
Reproducible in staging?: y
Reproducible in production?: y
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos:

Bug5813780_no_new_marker.mp4

Expensify/Expensify Issue URL:
Issue reported by: Applause internal team
Slack conversation:

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01a1559dc1509cad8c
  • Upwork Job ID: 1622812603121872896
  • Last Price Increase: 2023-02-07
@kavimuru kavimuru added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Nov 9, 2022
@melvin-bot
Copy link

melvin-bot bot commented Nov 9, 2022

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

@dylanexpensify
Copy link
Contributor

cc @marcaaron curious for your eyes on this given this PR

@melvin-bot
Copy link

melvin-bot bot commented Nov 14, 2022

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

@melvin-bot melvin-bot bot added the Overdue label Nov 14, 2022
@dylanexpensify
Copy link
Contributor

reviewing today!

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Nov 14, 2022
@dylanexpensify
Copy link
Contributor

reviewing today mel!

@melvin-bot melvin-bot bot removed the Overdue label Nov 14, 2022
@dylanexpensify dylanexpensify added the External Added to denote the issue can be worked on by a contributor label Nov 14, 2022
@melvin-bot
Copy link

melvin-bot bot commented Nov 14, 2022

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

@melvin-bot
Copy link

melvin-bot bot commented Nov 14, 2022

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

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

melvin-bot bot commented Nov 14, 2022

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

@melvin-bot melvin-bot bot changed the title No new marker if tab opened via link to the specific chat [$250] No new marker if tab opened via link to the specific chat Nov 14, 2022
@dylanexpensify
Copy link
Contributor

@marcaaron
Copy link
Contributor

@dylanexpensify Let's give @MonilBhavsar and @sobitneupane a chance to look into this.

@MonilBhavsar
Copy link
Contributor

I'm able to reproduce the issue. Looking into it

@MonilBhavsar
Copy link
Contributor

Upon investigation, looks like I'm not receiving Pusher event at all when report is not visible and there are some Pusher related errors in the log. I'll sort it out and update here

@dylanexpensify
Copy link
Contributor

Thanks @MonilBhavsar!

@puneetlath
Copy link
Contributor

@MonilBhavsar this is one of the oldest issues in the /App repo. To help us clear out the large backlog of bugs, can you:

  • Decide whether any proposals currently meet our guidelines and can be approved as-is
  • For any that can't, please take this issue internal and treat it as one of your highest priorities
  • If you have any questions, don't hesitate to start a discussion in #bug-zero

@melvin-bot
Copy link

melvin-bot bot commented Nov 21, 2022

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

@melvin-bot melvin-bot bot added the Overdue label Nov 21, 2022
@dylanexpensify
Copy link
Contributor

reviewing today!

@MelvinBot
Copy link

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

@JmillsExpensify
Copy link

Marked external again so that we can get some new ideas/proposals on how to solve it.

@melvin-bot melvin-bot bot removed the Overdue label Feb 7, 2023
@JmillsExpensify JmillsExpensify changed the title [$250] No new marker if tab opened via link to the specific chat [$1000] No new marker if tab opened via link to the specific chat Feb 7, 2023
@MelvinBot
Copy link

Upwork job price has been updated to $1000

@ghost
Copy link

ghost commented Feb 7, 2023

@JmillsExpensify @MelvinBot Question What the new marker set should look like ? answer would helps to understand the issue.

@Ashwanikhurana
Copy link

Proposal -

We can solve this problem using timestamp which is present in every message.. we can use pooling to maintain the last timestamp when the tab was active.. and it has a beauty that it is always in increasing order at the time of creating the list we can check if the last timestamp is less than the message timestamp, if found we can show a message something like X new messages.
We can use these 2 events window.addEventListener("focus", onFocus); window.addEventListener("blur", onBlur); to check if the user is active on the tab.

let me know if you found this solution helpfull for proposal

Thanks

@JmillsExpensify
Copy link

Oh the "new" marker already exists. Just mark any message unread in the app and you'll see a "new" line like below.

Screenshot 2023-02-07 at 10 51 32

@sobitneupane
Copy link
Contributor

@Ashwanikhurana Thanks for your proposal.

Can you please repost the proposal using the proposal template?

You can follow our guideline to know how you are supposed to propose a solution.

@ghost
Copy link

ghost commented Feb 9, 2023

@JmillsExpensify

Proposal

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

No New Marker when User A send message to User B if User B is not active(not logged in or open app using URL).

What is the root cause of that problem?

I have forked and downloaded the APP local and traced the code and found

const shouldDisplayNewMarker = reportAction.reportActionID === this.props.newMarkerReportActionID;

Above logic only compares ID for newMaker to appear. e.g(functionality work when right click and mark message as unread).
there is not check is the message is new or not.

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

add property isNewMessage : true with each message user sends.
depends upon User experience mark isNewMessage : false .
e.g(onFocus) onBlur or more in

componentDidMount or useEffect()
reason if component is already mounted means userB is active(window is open) and when new message receives mark message
isNewMessage : false, when receiving message from another user, where messageArray is increased.

How to know if message array from another user have increased ?
Answer : using this.setState((prevState) => {})

@sobitneupane
Copy link
Contributor

sobitneupane commented Feb 10, 2023

@harshjanipa Thanks for your proposal.
But I am not sure if I understood the root cause of the problem you stated. Can you please explain a bit about it?

It works as expected when a user is active and receives a message. But not if the user directly navigates to the chat via link. What's the reason for this behavior?

Suggestion: Please make use of permalink to refer to the code where the problem lies.

@melvin-bot melvin-bot bot added the Overdue label Feb 13, 2023
@MelvinBot
Copy link

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

@MelvinBot
Copy link

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

@sobitneupane
Copy link
Contributor

Waiting for proposals.

@melvin-bot melvin-bot bot removed the Overdue label Feb 14, 2023
@s77rt
Copy link
Contributor

s77rt commented Feb 14, 2023

@sobitneupane Would you please check this proposal again (or the updated one).
I believe this issue will be solved by the above proposal in combination with this proposal here.


Sorry for not providing much info in this comment, I think not much has changed since the initial proposal.

@abdulrahuman5196
Copy link
Contributor

@sobitneupane This proposal could solve this issue as well - #15019 (comment)

@sobitneupane
Copy link
Contributor

Thanks @s77rt and @abdulrahuman5196 .
I have gone through your proposals (#15019 (comment) and #15019 (comment)) in the other issue. It looks to me that the root cause of this issue and the other one is the same.

Am I missing something or is it the case?

@s77rt
Copy link
Contributor

s77rt commented Feb 14, 2023

@sobitneupane partly the same. After that issue get fixed we will have to apply this to actually fix this issue.

@sobitneupane
Copy link
Contributor

@MonilBhavsar I think we should either hold this issue or combine this issue with #15019 one.

@JmillsExpensify
Copy link

I commented in Slack, but I favor combining this issue in the other issue and making sure that we solve both in the same go. This was also reported internally, so no issues there.

@JmillsExpensify
Copy link

Thoughts on that last comment @sobitneupane? I think we should close this issue out.

@sobitneupane
Copy link
Contributor

Yes, we can close this issue. Let's make sure we solve this issue as well while handling #15019 issue.

cc: @thesahindia

@JmillsExpensify
Copy link

Done! Added the steps to the linked issue. Thanks everyone!

@MonilBhavsar
Copy link
Contributor

I agree with this. but I would say, let's add the workflow of this issue to the other issue and consider it while fixing it.
Or, create a new tracking issue describing all bugs with new marker line and close duplicate issues

@JmillsExpensify
Copy link

Screenshot 2023-02-16 at 10 44 28

@MonilBhavsar the case for this issue was already added to the linked issue. Screenshot from that OP for clarity.

@JmillsExpensify
Copy link

Separately from that, I love the idea of creating a tracking issue for the new marker line. We're experiencing multiple issues at this point and we're not going to holistically resolve until we look at everything holistically.

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 Help Wanted Apply this label when an issue is open to proposals by contributors
Projects
None yet
Development

No branches or pull requests