Page 1 of 1
Mobile chat does not update with new messages
PostPosted: 03 Jan 2017, 10:16
by Martok
I've upgraded to Arrowchat 2.0 and mobile chat isn't updating with new messages from other people. I've tested this and when others are chatting, their messages aren't appearing in the chatroom. Having spoken to another user, they say that it was the same prior to the 2.0 upgrade.
I've tested the 1-to-1 chat on mobile and that's fine, there's no issue with this. There only seems to be the problem with the chat not updating in a chatroom.
Any idea what the issue might be?
Re: Mobile chat does not update with new messages
PostPosted: 03 Jan 2017, 12:58
by MDAbruzzo
I just purchased yesterday and was having the same problem where new messages were not coming through unless I refreshed the screen.
I do not know why but through desperate troubleshooting I enabled both the push service setting "on" and the "ssl chat" on and almost immediately everything was coming in very quick and perfect.
I was having problems with only having regular push service active.
I do have a full https ssl site so I do not know if this is why i was having the problem and if that was the needed solution.
Any feedback from anyone that would know would be appreciated.
Re: Mobile chat does not update with new messages
PostPosted: 03 Jan 2017, 20:53
by Shank
I've been tracing this error down, and it seems to have something to do with the ArrowChat main script for popouts, and the "scrollHeight" value. When a new message comes in, there's no value, so it returns an undefined, and the script promptly crashes.
Re: Mobile chat does not update with new messages
PostPosted: 03 Jan 2017, 21:28
by Shank
Yeah, I have verified that in the popout window, if you get a new incoming private message, the core JS for the popout tries to get the value of the scrollHeight propery for a tab that hasn't been created yet, and then promptly crashes. I believe this has to do with the new "is X typing" function. It starts sending the "users is typing" message to the pop-out window BEFORE that user's tab has been created, so it's sending the message to an undefined part of the pop-out. I was hoping this was something I could find a quick fix for, but it looks to be deep into the custom code.
I am baffled as to why switching to SSL fixed this for the other user, though he maybe had a different issue.
Re: Mobile chat does not update with new messages
PostPosted: 04 Jan 2017, 00:46
by Jason
MDAbruzzo's issue is different. SSL sites must have the SSL service turned on.
I've marked this down and we'll take a look for the minor bug update coming shortly.
Re: Mobile chat does not update with new messages
PostPosted: 04 Jan 2017, 03:52
by Martok
Thanks, Jason.
I note that mobile chat for chatrooms seems to be updating here. However, I'm guessing that you'll be using the Push Server whereas I'm not using it.
Re: Mobile chat does not update with new messages
PostPosted: 04 Jan 2017, 08:43
by JGroot
We're having the same problem and getting a lot of complaints from our visitors. I hope the bug fix update comes really soon. Can you tell us something about that? Days, weeks?
We're not using a push server (and still no SSL).
Aside from this issue, compliments for the Arrowchat 2.0 update. Its a big plus! Thnx from the Netherlands.
Re: Mobile chat does not update with new messages
PostPosted: 04 Jan 2017, 09:44
by Shank
This is a MAJOR issue that needs to be addressed ASAP for me, or I am going to have to consider reverting to the old version for a while. I don't know about anyone else, but if there was a patch I could apply manually, I would do so right now. This is crippling my user's ability to communicate, and needs to be expedited.
Re: Mobile chat does not update with new messages
PostPosted: 05 Jan 2017, 10:42
by Shank
Well, I made my own fix, and it seems to be working!
In:
/arrowchat/public/popout/js/popout_core.dev.js you will find the uncompressed version of the, obviously, core popout JavaScript. The problem is that it's sending a typing notification to a user BEFORE the window from the sender has been created. This throws an "undefined" error when the code attempts to get the scrollHeight of a non-existent container, which in turn crashes the chat. Here's wher ethe bug is...
Line 2232:
function receiveTyping(id) {
var container = a("#arrowchat_popout_text_" + id)[0].scrollHeight - a("#arrowchat_popout_text_" + id).scrollTop() - 10;
var container2 = a("#arrowchat_popout_text_" + id).outerHeight();
if (a("#arrowchat_popout_text_" + id).length) {The issue is that the two container vars are being declared before checking to see if the message window exists. The fix is simple, move the if statement BEFORE that declaration:
function receiveTyping(id) {
if (a("#arrowchat_popout_text_" + id).length) { var container = a("#arrowchat_popout_text_" + id)[0].scrollHeight - a("#arrowchat_popout_text_" + id).scrollTop() - 10;
var container2 = a("#arrowchat_popout_text_" + id).outerHeight();
Save a the change in a new file. Rename
/arrowchat/public/popout/js/popout_core.js to
/arrowchat/public/popout/js/popout_core.old.js. Rename your saved copy of the .dev version to
/arrowchat/public/popout/js/popout_core.js, reload, and test. If it works for you, as it did for me, then run a JavaScript packer (
http://dean.edwards.name/packer/ ) to compress your changed code. It won't be nearly as compressed as the original, but better than nothing. This should tide you over until the team releases a real fix.
Re: Mobile chat does not update with new messages
PostPosted: 06 Jan 2017, 05:24
by JGroot
Doesn't work for us, unfortunately.
@Arrowchat team: How fast can we expect a quick fix/solution for this? We're getting a lot of complaints right now.
Re: Mobile chat does not update with new messages
PostPosted: 06 Jan 2017, 06:02
by Shank
JGroot wrote:Doesn't work for us, unfortunately.
@Arrowchat team: How fast can we expect a quick fix/solution for this? We're getting a lot of complaints right now.
If you want, I can take a look at your site, and see if I can't dig out the issue. Don't need any more access than any other standard user. Drop me a URL and I'll take a look for you, see if anything pops out at me?
Re: Mobile chat does not update with new messages
PostPosted: 06 Jan 2017, 06:23
by JGroot
Thanks a lot Shank, but we just found it! Everything is working fine again.
We made a change in /includes/functions/functions_receive.php.
Because mobile doesn't support multiple chats (/tabs), it gives only one chatroom ID, now the foreach isn't working properly. So we added some code on line 271, before the foreach loop, to handle this:
/**
* Tabs are unsupported, thus giving a single (string) ID, not an array
* Check if is array, if not force it.
*/
if(!is_array($chatroomid)) {
$intRoomID = $chatroomid;
$chatroomid = array();
$chatroomid[] = $intRoomID;
}
/* End fix */
Re: Mobile chat does not update with new messages
PostPosted: 06 Jan 2017, 12:59
by Jason
JGroot wrote:Thanks a lot Shank, but we just found it! Everything is working fine again.
We made a change in /includes/functions/functions_receive.php.
Because mobile doesn't support multiple chats (/tabs), it gives only one chatroom ID, now the foreach isn't working properly. So we added some code on line 271, before the foreach loop, to handle this:
/**
* Tabs are unsupported, thus giving a single (string) ID, not an array
* Check if is array, if not force it.
*/
if(!is_array($chatroomid)) {
$intRoomID = $chatroomid;
$chatroomid = array();
$chatroomid[] = $intRoomID;
}
/* End fix */
Awesome, thanks for the fix! We're looking to get the patch out within the next week or so. I think these two issues are major enough for us to start compiling it now. We usually like to wait a couple weeks for bug reports to come in.
Re: Mobile chat does not update with new messages
PostPosted: 08 Jan 2017, 11:31
by chaos4eva
Jason wrote:JGroot wrote:Thanks a lot Shank, but we just found it! Everything is working fine again.
We made a change in /includes/functions/functions_receive.php.
Because mobile doesn't support multiple chats (/tabs), it gives only one chatroom ID, now the foreach isn't working properly. So we added some code on line 271, before the foreach loop, to handle this:
/**
* Tabs are unsupported, thus giving a single (string) ID, not an array
* Check if is array, if not force it.
*/
if(!is_array($chatroomid)) {
$intRoomID = $chatroomid;
$chatroomid = array();
$chatroomid[] = $intRoomID;
}
/* End fix */
Awesome, thanks for the fix! We're looking to get the patch out within the next week or so. I think these two issues are major enough for us to start compiling it now. We usually like to wait a couple weeks for bug reports to come in.
I can confirm this fixed my updating issue so thanks for the fix.
Keep everything ticking over until its fixed by the arrow chat team.
Re: Mobile chat does not update with new messages
PostPosted: 16 Jan 2017, 18:42
by toptickers
I want to mention that I am also experiencing this issue and while I see ya'll provided a solution that seems to fix the problem I am still noticing that not all messages are going through to the mobile application.
For example, if I send messages in an order such as '1' then '2' then '3' then '4' etc, from my desktop the only message that will appear in the mobile app will be the one '4'. I can continue sending messages but it seems random which ones actually get through. While if i do this between two different browsers like Chrome and Edge each message appears to go through just fine.
* I also have SSL on my site and don't have a push server, Am I suppose to enable some function in the admin settings or leave it alone?
Re: Mobile chat does not update with new messages
PostPosted: 07 Feb 2017, 01:05
by THeringa
Thanks JGroot, your solution works!
Hartelijk dank vanuit Nederland :)
Re: Mobile chat does not update with new messages
PostPosted: 07 Feb 2017, 14:23
by elynx
Thank you for the fix ! Superstars !
By the way, once i notice the chat was behaving in a mobile exactly the same as the desktop version.
And it was actually working fine !!
So just a wonder ... would it be easy to override the mobile detection and use arrowchat the desktop way on any type of device ?
Would be great to test extensively. When it happened (for some reason) on my galaxy S7, it was super cool.
Cheers
Re: Mobile chat does not update with new messages
PostPosted: 14 Mar 2017, 11:18
by elynx
After few weeks testing the workaround.
It doesn't really work.
We still receive notifications of new messages on mobile tab.
Opening the mobile chat section doesn't show any new message.
Re: Mobile chat does not update with new messages
PostPosted: 14 Mar 2017, 11:19
by elynx
Question is: When the correction will be available?
Without it, mobile version is just not usable for incoming messages. As simple as that.
Re: Mobile chat does not update with new messages
PostPosted: 14 Mar 2017, 23:37
by elynx
Jason wrote:JGroot wrote:Thanks a lot Shank, but we just found it! Everything is working fine again.
We made a change in /includes/functions/functions_receive.php.
Because mobile doesn't support multiple chats (/tabs), it gives only one chatroom ID, now the foreach isn't working properly. So we added some code on line 271, before the foreach loop, to handle this:
/**
* Tabs are unsupported, thus giving a single (string) ID, not an array
* Check if is array, if not force it.
*/
if(!is_array($chatroomid)) {
$intRoomID = $chatroomid;
$chatroomid = array();
$chatroomid[] = $intRoomID;
}
/* End fix */
Awesome, thanks for the fix! We're looking to get the patch out within the next week or so. I think these two issues are major enough for us to start compiling it now. We usually like to wait a couple weeks for bug reports to come in.
Hi everyone, please don't think this is the final workaround. It is not ;).