Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Room Occupants" count increased sometimes when a user leaves the room. #30

Closed
jstressman opened this issue Sep 1, 2011 · 20 comments
Closed
Labels
Milestone

Comments

@jstressman
Copy link

I'm not sure if this because I have a user in my user list with escape sequences in their name. (we're running mod_auth_phpbb3.lua with Prosody to allow users with spaces etc in their names to still authenticate. They are automatically escaped... so "Joey Vega" would end up as "Joey\20Vega" etc. http://prosody.im/pastebin/41b9deec-7ebc-4f7a-85c2-57bd9668c075 )

I thought this only appeared in Firefox, but I now see it in both Chrome and IE9 as well... so apparently it's not just Firefox.

http://i32.photobucket.com/albums/d12/phreadom/roomcount5.png

And right now there are 8 people in the room, but it shows 30 etc. (Chrome and IE each show 24, since I joined with those later)

What suggestions would you have for how I might track this down? I don't see anything immediately suspicious in the Firefox web console log.

I have a number of other issues to work out with the escaped username, but I haven't started tackling that yet. (for instance you can't private message them. but I'll file those in a separate issue.)

@jstressman
Copy link
Author

I've been checking on the 3 clients (Firefox, Chrome, and IE) and they're now at 36 for FF, and 30 for Chrome and IE... so the increment is the same amount for all of them over time.

@mweibel
Copy link
Member

mweibel commented Sep 2, 2011

Hi jstressman,

I think the first issue about displaying wrong usernames will be fixed with issue #17.

About the room occuppants count... That's a really strange behaviour.
When someone leaves a room, do you see any decrease of the online users number?

@jstressman
Copy link
Author

Usually yes... that's what's kind of weird about it... it doesn't always happen. I'll have to try keeping a really close eye on it to see when it actually increments the room occupant count. I've seen it happen at least once when someone left the room... but that's as much as I've noticed so far.

I'll try to keep a closer eye on it. We're about to switch the test site over to the main site, so I should see a lot more traffic in the room that will make it easier to test for.

@mweibel
Copy link
Member

mweibel commented Sep 2, 2011

Maybe it also has something to do with the incorrect handling of spaces and utf-8 chars. So .. could it be that it works when a user with a "normal" username leaves and that it doesn't work when a user with a username having spaces in it leaves?

@pstadler
Copy link
Member

pstadler commented Sep 3, 2011

I experienced the same in a private chat some time ago. The number of occupants was displayed as four instead of two. It's most-likely not related to character / utf-8 issues.
The only place where count gets modified is Candy.View.Pane.Roster.update().

Is it possible to run into a race condition here? https://github.com/amiadogroup/candy/blob/master/src/view/pane.js#L1425

I observed (in Firefox) that sometimes if the browser window of the chat has no focus, lot of animations of entering / leaving users happen at the moment it gains focus again. The animations are kind of delayed. Could this be somehow related to this issue?

@jstressman
Copy link
Author

I just noticed that after being disconnected for a few hours and logging back in from the "Disconnected" dialog box, the user list isn't correctly updated. It still shows a number of users as being on-line although they logged off while I was disconnected.

http://i32.photobucket.com/albums/d12/phreadom/candybug2.png

You can also see the large Room Occupant count as well.

Might this have something to do with users who use external clients like Pandion or Pidgin etc? Something similar to #12 maybe? Many of our users use external clients to connect to the chat.

@jstressman jstressman reopened this Sep 4, 2011
@pstadler
Copy link
Member

pstadler commented Sep 5, 2011

Hey J.

Two questions:
How are you getting disconnected? (e.g. laptop sleep mode, leaving all rooms, ...)
Is the number of users only wrong after reconnecting?

@jstressman
Copy link
Author

This was caused by the server going down. This is a desktop computer that's always on. I didn't leave any rooms etc. And the number of users goes wrong just from people coming and going while I'm still connected.

If I leave the chat open long enough, the number will just get higher and higher as I idle and people come and go.

There are 4 people in the chat at the moment, but the "Room Occupants" count says 34. :) It's climbed to that over the course of the day since I manually reloaded it after adding a second room this morning (which reset the Room Occupants count and User List to the correct users and count). I haven't been disconnected since then and haven't opened any private chats or closed either of the room tabs.

The user list after reconnecting through the "Disconnected" dialog seems to be a matter of it just going right back to the chat where you left off, without doing extra checks to refresh the user list. I think the same thing happens with the Room Occupants count after reconnecting from a disconnect, but I'm not sure.

Reloading the chat (which goes back to the main login) fixes both issues.

@pstadler
Copy link
Member

pstadler commented Sep 5, 2011

Thanks for the information. We'll look into this.

@swissmanu
Copy link

same behaviour after kicking a user... counter does not decrease.

@pstadler
Copy link
Member

pstadler commented Oct 5, 2011

Please check the latest version in dev branch (commit 9e40663): https://github.com/amiadogroup/candy/zipball/dev

@mweibel
Copy link
Member

mweibel commented Oct 13, 2011

@jstressman: Could you already try the latest dev version?

@jstressman
Copy link
Author

I was trying to figure out how to correctly overwrite functions before I put that on the production server to test.

I suppose I could just manually make the changes as before and run with it, since I already know the xep 0106 branch works on my development server and I want to get that rolled out as well.

I'll go ahead and see if I can get this rolled out tonight and update with my findings.

@mweibel
Copy link
Member

mweibel commented Oct 13, 2011

If you need some more infos about the way on how to correctly overwrite functions, please don't worry about asking :) (But maybe on the mailinglist).

Would be nice to hear if it works with this fix included. But maybe we need some additional fixes.

@jstressman
Copy link
Author

Well, after an initial hiccup of grabbing the wrong code and wondering why it was still broken, it appears that it's working now with the actual dev code. :)

I'll keep an eye on it throughout the day, but it looks like that probably fixed it.

@pstadler
Copy link
Member

Great, please keep us up-to-date! :-)

@jstressman
Copy link
Author

Ok, final update on this... it's 14 hours later and the user count in the chat is still correct (even after heavy use), so I'd say that pretty definitively fixed it.

@mweibel
Copy link
Member

mweibel commented Oct 14, 2011

Good to hear!

@pstadler: I think a new release would be good. But maybe the anonymous connection needs a fix before that (see candy support #155).

@pstadler
Copy link
Member

@jstressman: great! :-)

@mweibel: is this a problem of Strophe?

@mweibel
Copy link
Member

mweibel commented Oct 14, 2011

@pstadler: Not sure yet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants