stream-chat-react-native icon indicating copy to clipboard operation
stream-chat-react-native copied to clipboard

Bug · Messages not being auto marked as read while inside channel

Open charltongroves opened this issue 6 years ago • 12 comments

Describe the bug Hey, When you open a channel, it immediately marks all messages as read. However, if you stay in that channel and talk to someone, all of the messages that get sent in that channel will stay marked as 'unread' until you re-open the channel.

This doesn't make much sense, if you have a channel open, then presumably you are reading the messages that are coming through, so these messages should be auto marked as read.

Dev environment info (please complete/provide the following information):

  • Package version. 0.6.3
  • react-native or expo version n/a
  • Device/Emulator (android/ios) and OS version n/a

To Reproduce Steps to reproduce the behavior:

1.Go into a channel 2 send some messages to that channel from another device 3 notice how the messages are unread even if you reply to them.

Expected behavior Messages coming into a channel which you are currently looking at should mark those messages as read.

Screenshots notupdating

charltongroves avatar Feb 24 '20 05:02 charltongroves

We are also seeing this behavior, would love to know if there is a workaround or fix.

kgstaley avatar Apr 24 '20 22:04 kgstaley

@charltongroves @kgstaley I am not able to recreate this issue. Can you try updating to the latest version and seeing if the issue is resolved or not. I can dig deeper if that doesn't help fix it

virdesai avatar May 19 '20 21:05 virdesai

closing from inactivity

virdesai avatar Oct 14 '20 15:10 virdesai

I'm seeing this behavior again on android devices. stream-chat version 2.9.0

croche-gl avatar Feb 01 '21 17:02 croche-gl

I'm facing this issue. I tried to mark as read the channel messages manually but still not working. Any thought?

Marcoo09 avatar Sep 07 '21 03:09 Marcoo09

Any thought?

Marcoo09 avatar Sep 10 '21 17:09 Marcoo09

I'm facing the same issue. Any update?

avivm avatar Nov 04 '21 09:11 avivm

Hey @avivm @Marcoo09 This issue has been resolved as part of 3.9.x. I would recommend upgrading to latest version of stream-chat-react-native

vishalnarkhede avatar Nov 04 '21 09:11 vishalnarkhede

I'm using the following versions and still have the issue. "stream-chat": "^3.13.1", "stream-chat-expo": "^3.9.1",

For anyone with the issue I have fixed it using:

useEffect(() => {
    if (channel) {
      const unsubscribe = channel.on("message.new", (event) => {
        channel.markRead();
      });
      return () => {
        unsubscribe.unsubscribe();
      };
    }
  }, [channel]);

avivm avatar Nov 04 '21 10:11 avivm

@vishalnarkhede We are facing the same issue in our application on Android. The problem does only occur when the message list in the chat is no longer than your screen size. When having a lot of messages the screen will scroll, and the message read event is dispatched.

An example can be found in the video below.

https://user-images.githubusercontent.com/1516413/152492398-6b9d7955-9fc2-4f72-8323-38f000c973b1.mov

sandergo90 avatar Feb 04 '22 07:02 sandergo90

Can this issue be reopened? it's still occurring on Android.

sandergo90 avatar Feb 09 '22 14:02 sandergo90

I am having this issue on react client too. Marking messages as read feature is definitely working inconsistently. Sometimes it just works correctly, sometimes you need to open and close channel. I also set up a web push hook and listening those message.read events and I could not figure out what triggers those events or when message is marked as read.

DenizKucukozturk avatar Feb 18 '22 09:02 DenizKucukozturk