Closed haris-qayyum closed 3 years ago
Hello @haris-qayyum , Can you please share the code snippet you are using to mark the message as read?
Hi @adityagokula2210,
I'm calling the following method to mark any message as read.
public static void markMessageAsRead(BaseMessage baseMessage) { CometChat.markAsRead(baseMessage.getId(), baseMessage.getSender().getUid(), CometChatConstants.RECEIVER_TYPE_USER); }
Can you please share your appId and a couple of sample users so that I can test this at my end?
implementation 'com.cometchat:pro-android-chat-sdk:2.1.1'
public static String APP_ID = "27834d968f8f279";
You can use Client One user.
Also, can you please try using version 2.1.6 and confirm if the same crash is happening in 2.1.6 version too ?
I even tried with your latest beta version, but still, I was getting the same crashing..
Can you give me 2 UIDs that i can use for testing at my end?
232801eb-b1fb-44ff-aaf5-84c3a97757a0 70b34158-3204-4dd1-9b6c-7b5653a25b0a
I was thinking if you guys can handle that exception in any try/catch block then It never crash the main app.
can you please check your database to see such records where receipt type is null?
Hello @haris-qayyum Can you please stop using the two UIDs for testing as we are using them here and it's causing us some problems in investigating the crash
Yes, sure.. Sorry for the inconvenience..
@haris-qayyum I can see that the same users are logged in from some iOS devices too. Can you please log the users out of all the devices or kill all the apps and then let me know so that we can check this
Thanks
Sorry again, I asked everyone to not use these but don't know who is using these accounts.. So, Please use these accounts, they are new and not in use by any developer here. 14a35922-8187-4bc2-aff0-98a5b39cd83a 878a6e4c-8c0d-4de8-8265-8d85181a2076
Thanks
Hello @haris-qayyum We have identified the issue. The issue will only be encountered when the same user is logged in from 1 android device and 1 iOS device. There is some inconsistency with the format of the data shared by the iOS SDK while marking the message read when there are multiple devices involved. We have informed the iOS team about this and we will be releasing a patch in the next iOS SDK version. In the next version of the Android SDK we will be adding an error handling mechanism so that it does not cause a crash. We will let you know once both these versions are live
Thanks
Issue fixed in version 2.1.7-beta3.
Describe the bug First of all, I'm not using comet-chat UI Kit, instead, I'm using comet-chat SDK with my own UI... Everything was working fine till the last 2 days.. but today (after the weekend) when I'm sending any message or receiving any calls etc, my application is being crashed with an error
java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.String.equalsIgnoreCase(java.lang.String)' on a null object reference at com.cometchat.pro.core.CometChat$1$1.run(CometChat.java:95) at android.os.Handler.handleCallback(Handler.java:899) at android.os.Handler.dispatchMessage(Handler.java:100) at android.os.Looper.loop(Looper.java:238) at android.app.ActivityThread.main(ActivityThread.java:7853) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:984)
As far as I debug, it is being crash due to 'null' value of 'messageReceipt.getReceiptType()'.
Please fix that issue ASAP. Thanks.