[NEW] Support LiveChat messages
Thanks for the great new version of this Android client! I've run into a possible bug, here is the info:
Description
While a notification appears in the client, tapping on the message produces the error message "The required "roomId" or "roomname" param provided does not match any channel [error-room-not-found]. As well, the text from the Livechat visitor is not visible.
Devices and Versions
Your Rocket.Chat.Android version: (e.g. 2.0.4) Your Rocket.Chat Server version: (e.g. 0.63)
Mobile device model and OS version: (e.g. "Samsung G7 - Android 7")
Steps to reproduce
- Start livechat on Website
- Launch client, tap on Livechat entry
Logs
Thanks very much, Paul
Reply works but not in the Chat view :( I need this but I hope their fix it soon.
+1 any news?
@cypa We're currently focusing in other priorities, like adding database support to the application and other basic features like supporting all the authentication methods, list of files, better notification support and some bugs. This is going to be addressed in future releases for sure. 👍
Thanks for the update @rafaelks
This is a bug and it's not on the android app, but on the server side (API). It is easy to replicate it: Get a valid userid and token and then: curl -H "X-Auth-Token: XXXXX" -H "X-User-Id: YYYY" http://localhost:3000/api/v1/channels.roles?roomId=AAAA It will work for any chatroom except for livechat rooms.
The reason is that when a livechat room is created it is missing the room name: Example: "general" room: { "_id" : "Gzysadfsadfp7k", "name" : "general",
This field "name" is not created for livechat rooms and the API search by the room name won't work. The android client uses the room name for the search.
I created a very simple temporary fix on the server (rocketchat_api.js line 946). My chatrooms id start with abc, so I set the roomId with the parameter received from Android: if (params.roomName) { if (params.roomName.startsWith("abc")) { params.roomId = params.roomName; } }
It will force the server to search the room by id.
For an actual fix, livechat should also create the field "name" or the android client should make the call based on the roomid. I couldn't find where Android makes the api call to the server to change the call to roomId (i.o. roomName)
Just FYI, I'm running server version 0.70.4 and getting this same error on Android client. I was able to fix it by adding the following around line 959 of rocketchat_api.js:
if (!room) {
room = RocketChat.models.Rooms.findOneByDisplayName(params.roomName, { fields });
}
And after making that change, on line 965, changing:
if (!room || room.t !== 'c')
to:
if (!room || (room.t !== 'c' && room.t !== 'l'))
It fixes the issue, but I don't know if further issues will arise by returning a room type that wasn't originally intended. It doesn't seems to cause problems on the mobile app or website so far.
Just FYI, I'm running server version
0.70.4and getting this same error on Android client. I was able to fix it by adding the following around line959ofrocketchat_api.js:if (!room) { room = RocketChat.models.Rooms.findOneByDisplayName(params.roomName, { fields }); }And after making that change, on line
965, changing:if (!room || room.t !== 'c')to:
if (!room || (room.t !== 'c' && room.t !== 'l'))It fixes the issue, but I don't know if further issues will arise by returning a room type that wasn't originally intended. It doesn't seems to cause problems on the mobile app or website so far.
This works but not for attachment. Also livechat functionality like editing userinfo, forwarding are not allowed.
Any update on this?
It is still not fixed in the newest andorid app. I just tried. "The required "roomId" or "roomname" param provided does not match any channel [error-room-not-found" still occur.