After upgrading from 7.x-1.3 to 7.x-1.4, I noticed that Drupalchat doesn't initially show any users for the first few seconds, even if there is at least one user. Here is how to reproduce the issue:

1) Open website in a new window (or refresh existing window).
2) Immediately click the chat bar to open it and see that there are no users visible, no matter how many users there really are.
3) Leave it open, and the users will all of a sudden be visible after a few seconds.

A couple of screenshots are attached for reference. Any ideas?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jay.lee.bio’s picture

Issue summary: View changes
jay.lee.bio’s picture

I dug more into this and realized that the problem actually first started happening since 7.x-1.0. I compared this to 7.x-1.0-beta33, and noticed that the main difference between them was the disappearance of the option "Normal AJAX Send message delay". So is there a good reason why this was deleted?

P.S. To easily reproduce the issue, just change the "Chat List Latency" & "Normal AJAX Refesh Rate" to at least 10 seconds, because that's exactly how long it stays until the chat window refreshes itself and the problem goes away.

brtamas’s picture

Hi,

If you use longpoll method, it can be longer. It waits until the execution time reached.
I attach a patch for longpoll method. With this patch the module at first poll gives back the data and doesn't wait for changes.

jay.lee.bio’s picture

Brtamas, thanks for the patch. I just tested it and found that it works, although not perfectly. Previously, I've been using "Normal AJAX" and just changed it to "Long Polling" to test the patch (I honestly don't even know what the difference is). So now what happens is that instead of taking however long it takes according to the "Chat List Latency" for the users to appear, it takes around 3-4 seconds. Again, it's not perfect, but it's still definitely way better than what I had before, so I'll use it. Thanks again.

jay.lee.bio’s picture

Status: Active » Reviewed & tested by the community