CometChat.markAsRead is not working properly as expected

Hi CometChat,
I have been using your product for while, And now I’m facing an issue with the markAsRead function.
It was working fine previously but now for the past two weeks, it’s not working as expected. I tried to debug that’s what going wrong but didn’t find anything.

Version->
@cometchat-pro/react-native-calls”: “^2.1.1”,
@cometchat-pro/react-native-chat”: “^2.3.4”,

 if (
                message.getSender().getUid() !== user.getUid() &&
                !message.getReadAt()
              ) {
                if (
                  message.getReceiverType() === CometChat.RECEIVER_TYPE.USER
                ) {
                  console.log(
                    "User--->",
                    message.getId().toString(),
                    message.getSender().getUid(),
                    message.getReceiverType()
                  );
                  try {
                    CometChat.markAsRead(
                      message.getId().toString(),
                      message.getSender().getUid(),
                      message.getReceiverType()
                    );
                  } catch (e) {
                    console.log("Error--->", e);
                  }
                } else if (
                  message.getReceiverType() === CometChat.RECEIVER_TYPE.GROUP
                ) {
                  console.log(
                    "Group--->",
                    message.getId().toString(),
                    message.getReceiverId(),
                    message.getReceiverType()
                  );
                  try {
                    CometChat.markAsRead(
                      message.getId().toString(),
                      message.getReceiverId(),
                      message.getReceiverType()
                    );
                  } catch (e) {
                    console.log("Error--->", e);
                  }
                }
              }

I have also checked for the connection status and it is showing “connected”.
Please let me know what could be the possible issue.

Thanks
Avi Choudhary

Hi @Avi,

Can you please let us know are you facing this issue for user or group conversations or both? Also, can you please share your appID with us so that we can get this checked on our end?

Warm Regards,

CometChat
Mayur Bhandari

Hi @mayur.bhandari
I have faced this issue for both user and group as well.

Is it safe to share appID here?

Thanks.

Hi @Avi,

You can send the appID via direct message or we can start an email thread to debug this further. Please let me know which is more convenient for you.

Thanks,

CometChat
Mayur Bhandari

Hi @mayur.bhandari

A direct message like where?, Email thread is also a good option.

Thanks.

Hey @Avi,

You can write to us at help@cometchat.com. You can also send us a message directly.

Thank you.

Provesha Pyne
CometChat Support

1 Like