Unread message retrieval stopped working?

Hello,

We are using CometChat Pro Javacript SDK and started experiencing the unread message count retrieval not working any more - both API and SDK are not working.

We also did a tests on code that did not involve any unread message count work and it is not working.
And we also performed tests from outside our app - so we did a get request via https://reqbin.com/ and we send a test message from within https://app.cometchat.io/apps/ourAppID/messages and the get request returns us:
{
“data”: [],
“meta”: {
“pagination”: {
“total”: 0,
“count”: 0,
“per_page”: 100,
“current_page”: 1,
“total_pages”: 1
},
“cursor”: {
“id”: 881,
“affix”: “prepend”
}
}

Best,
Mihaela

1 Like

Created a new app and did all of the calls outside of our app by means of reqbin, please see below
–get the users – GET
https://api-us.cometchat.io/v2.0/users?perPage=100&page=1
–header
appid:15389fb197a041d
apikey:bf6e1d2d822e2f2400cfa961511c3bd15c564f2f
content-type:application/json
accept:application/json

–reqbin link
https://reqbin.com/c9ljk1wu

–reponse
HTTP/1.1 200 OK
Date: Thu, 19 Mar 2020 12:17:08 GMT
Content-Type: application/json
Content-Length: 1063
Connection: keep-alive
Server: Apache
Cache-Control: no-cache, private
X-RateLimit-Limit: 100000
X-RateLimit-Remaining: 99999
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: OPTIONS,HEAD,GET,POST,PUT,PATCH,DELETE
Access-Control-Allow-Headers: Content-Type,Accept,Cache-Control,Authorization,X-Requested-With,appId,apiKey,authToken

{“data”:[{“uid”:“superhero5”,“name”:“Cyclops”,“avatar”:“https://data-us.cometchat.io/assets/images/avatars/cyclops.png",“status”:“offline”,“role”:“default”,“createdAt”:1584618242},{“uid”:“superhero4”,“name”:“Wolverine”,“avatar”:“https://data-us.cometchat.io/assets/images/avatars/wolverine.png”,“status”:“offline”,“role”:“default”,“createdAt”:1584618242},{“uid”:“superhero3”,“name”:“Spiderman”,“avatar”:“https://data-us.cometchat.io/assets/images/avatars/spiderman.png”,“status”:“offline”,“role”:“default”,“createdAt”:1584618242},{“uid”:“superhero2”,“name”:"Captain America”,“avatar”:“https://data-us.cometchat.io/assets/images/avatars/captainamerica.png",“status”:“offline”,“role”:“default”,“createdAt”:1584618242},{“uid”:“superhero1”,“name”:"Iron Man”,“avatar”:“https://data-us.cometchat.io/assets/images/avatars/ironman.png",“status”:“offline”,“role”:“default”,“createdAt”:1584618242}],“meta”:{“pagination”:{“total”:5,“count”:5,“per_page”:100,“current_page”:1,“total_pages”:1},“cursor”:{“updatedAt”:1584618242,“affix”:"prepend”}}}


–Send message from Cyclops to Wolverine
–Cyclops superhero5 Today at 1:44 PM default

–POST
https://api-us.cometchat.io/v2.0/users/superhero5/messages
–Header
appid:15389fb197a041d
apikey:bf6e1d2d822e2f2400cfa961511c3bd15c564f2f
content-type:application/json
accept:application/json
–Data
{“receiver”:“superhero4”,“receiverType”:“user”,“category”:“message”,“type”:“text”,“data”:{“text”:“123”}}

–reqbin link
https://reqbin.com/3gazn71n


–Get Wolverine’s messages
–Wolverine superhero4 Today at 1:44 PM default
–Get
https://api-us.cometchat.io/v2.0/users/superhero4/messages?unread=true
–Header
appid:15389fb197a041d
apikey:bf6e1d2d822e2f2400cfa961511c3bd15c564f2f
content-type:application/json
accept:application/json

–reqbin link
https://reqbin.com/krfxnzdv

–response
{
“data”: [],
“meta”: {
“pagination”: {
“total”: 0,
“count”: 0,
“per_page”: 100,
“current_page”: 1,
“total_pages”: 1
},
“cursor”: {
“id”: 2,
“affix”: “prepend”
}
}
}

1 Like

Hi @MihaelaCazan,

Please use endpoint URI as:

https://api-us.cometchat.io/v2.0/users/superhero4/messages?unread=true&count=true

1 Like

Hello @ketan.yekale,

I want all of the unread messages listed so that I can filter the count by myself but it is not working any more.
So the unread+count works but without the count is does not and it used to work up until a few hours ago today.
I can not use the count because of the following: if I do a video call, an audio call and send a message I receive 5 unread messages and in our chat we do not display x initiated call and y did not answer call we just display y missed call made by x (aka missed call just like Skype orWhatsApp show) and with this count approach I can not filter them any more.

Please see the below scenario of what our problem is:

  1. User 1 audio calls User 2, User 2 is not logged in yest so it misses the call
  2. User 1 video calls User 2, User 2 is not logged in yest so it misses the call
    3 User 1 writes a message to User 2,User 2 is not logged in yet so misses this message as well
  3. User 2 logs in the app and should see that has 3 unread messages and when opens the conversation with Use 1 should see the following: Missed audio call, Missed video call and the missed message
  4. If I used the count the received number is 5 which is incorrect in our system as I want to ignore the initiated-rejected, initiated-accepted call combos and I just want the end result.

As mentioned earlier this worked until a few hours ago so we would appreciate it the unread message retrieval would be possible once more.

Best,
Mihaela

1 Like

Hi @MihaelaCazan,

Thank you for reporting the issue with fetching unread messages. During high load, non-essential features like message read-receipt is temporarily paused until the servers are auto-scaled. This process usually lasts 5-10 minutes. In the last few hours, we’ve had an unusual increase in load and that might have caused this issue. I’ve checked and everything is working perfectly now.

Can you please check on your end?

Hello @ketan.yekale,

Yes, at the moment the unread message retrieval works once more.

Best,Mihaela

1 Like