I've noticed a few issues with the shoutbox that others have also mentioned, but they seem to have had no responses so far.
First, I am also running into the issue where shouts seem to stop sending at some point for no apparent reason. Sometimes a page reload fixes it, sometimes logging out and back in fixes it, and sometimes nothing seems to immediately fix it. My users are getting frustrated with this so any help would be appreciated. Next time I see this I will be sure to look at the ajax response and add more info.
EDIT: I just hit the issue again and had a look at the ajax. The request going through contains the correct shout I'm sending, and the response comes back without error, but fails to include the new shout (it contains the prior 50 shouts only). I should point out that the shoutbox has 50 shouts and that is what I have the max displayable set to, so perhaps it's a limit issue? In this instance I had to logout and log back in to get new shouts to appear.
Second, I have created a few custom chat tabs and after a while when you click on them they just disappear... If I reload the page they come back. I think this has something to do with being set to idle, but I'm not certain. And by the way, I have set it to not flag admins as idle, but that option doesn't seem to work either.
EDIT: So I did some further debugging and found that the tabs are disappearing due to this block of code in core/packages/dbtechvbshout/api/vbshout/shoutbox.php in the callNamed() function:
Code:
else
{
if (!count(array_intersect(vB::getUserContext()->fetchUserGroups(), explode(',', self::$chatroom['membergroupids']))))
{
// Usergroup no longer a member
self::$fetched['error'] = 'disband_' . $args['chatroomid'] ;
}
}
I added some debug and verified that the userid being queried here is 0, but it should be a valid user id like 1. So it appears the user information is being lost which I assume is due to some session data expiring perhaps. I'm also guessing this is probably the same thing leading to messages not being sent after a while. So I need to figure out what it is that causes the user data cache to seemingly disappear and require the user to logout and back in to get it back. I'm getting closer... lol
EDIT 2: I have confirmed it is definitely the session expiration that is causing BOTH of the problems I listed. So my question now becomes how do I fix this? Even if you click Remember Me when logging in the session expires if you are idle. The vBulletin software will check the userid and password cookies and renew the session and everything is fine, but the chat requires you to log out and back in after every session expiration... :( The second problem is that interacting with the vbshout window like sending shouts or clicking tabs doesn't update the vbulletin lastactivity, so this causes the session to expire when in reality there is activity... I think the vbshout should be updating the lastactivity to prevent the session from expiring.
I'd also like to vote for a responsive design at some point because vb shrinks and makes the chatbox look terrible.
Let me summarize what I believe needs to be fixed:
- Any activity in the shoutbox should update the vb session activity by calling doLastVisitUpdate() followed by save().
- The session data needs to be refreshed for the cases where it should never expire (e.g., user clicks Remember Me).
- The option to never set a usergroup to idle needs to be fixed, it doesn't work.
- When a session does expire, the chatbox should be updated to reflect this (e.g., the text entry window should disappear, custom tabs a guest doesn't have access to should disappear, etc.) Otherwise users have no idea why it appears they can shout, but they really can't. You could easily do this by receiving a custom response from an ajax query. You already do something similar by setting a user to idle and removing their name from the chat.
I plan to buy the pro version for some of the additional features, but I won't buy it if I'm going to continue to have all these issues... :-/
EDIT: Well I seem to be talking to myself, but I've made another discovery... If I set the session timeout to something large like 2 hours, then this problem completely goes away... So now I'm utterly confused. If the session timeout is 15 minutes and click remember me, then users are logged out after 15 minutes no matter how much they are chatting. If I set it to 2 hours and log in with remember me checked and walk away for 3 hours, I can come back and chat with no problem... I'm sure I'm just missing something basic here... can anyone fill me in please???
EDIT2: I figured out that every 60 minutes the security token is replaced which updates the lastactivity so as long as the session timeout is greater than one hour it will never time out. However, I don't think we should have to rely on this and keep the session timeout over an hour...