Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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?
Comment | File | Size | Author |
---|---|---|---|
#3 | drupalchat_7_1_5_longpol_first_poll_quicker.patch | 1.32 KB | brtamas |
Drupalchat Yes Users.png | 6.25 KB | jay.lee.bio | |
Drupalchat No Users.png | 3.45 KB | jay.lee.bio |
Comments
Comment #1
jay.lee.bio CreditAttribution: jay.lee.bio commentedComment #2
jay.lee.bio CreditAttribution: jay.lee.bio commentedI 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.
Comment #3
brtamas CreditAttribution: brtamas commentedHi,
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.
Comment #4
jay.lee.bio CreditAttribution: jay.lee.bio commentedBrtamas, 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.
Comment #5
jay.lee.bio CreditAttribution: jay.lee.bio commented