Number of forum members online is wrong !
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Plusnet Community
- :
- Forum
- :
- Feedback
- :
- Community Site Feedback
- :
- Number of forum members online is wrong !

Number of forum members online is wrong !
11-12-2017 8:19 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
The number shown after "Who's Online" does not match the number of avatars displayed.
I did check whether this was a transient problem such as someone logging-in or leaving while the display was being created, but I left the page then came back twice, and the inconsistency was still there.
No matter why the number might be different, the figure shown should always match the number of avatars displayed.
Re: Number of forum members online is wrong !
11-12-2017 8:31 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
@Anonymous That is something I haven't seen before, but I have noticed that I 'disappear' from the list occaisionally - Jack is aware of this and has a case open with Lithium.
Re: Number of forum members online is wrong !
11-12-2017 8:32 AM - edited 11-12-2017 8:32 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
It is quite likely linked to this report https://community.plus.net/t5/Community-Site-Feedback/Not-showing-as-online/m-p/1482922#M13515 in some way.?
Both symptoms could be fixed in the same change?
Superusers are not staff, but they do have a direct line of communication into the business in order to raise issues, concerns and feedback from the community.
Re: Number of forum members online is wrong !
11-12-2017 8:33 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Thamks @MauriceC - I was just looking for that post to link to!
Re: Number of forum members online is wrong !
11-12-2017 10:10 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Frontend Web Developer | www.plus.net
If you have an idea to improve the community, create a new topic on our Community Feedback board to start a discussion about your idea.

Re: Number of forum members online is wrong !
11-12-2017 10:28 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
@jaread83 - Not to sure how you’re going to do this but I’m assuming JavaScript, if this is the case then can I suggest that you might want to build a union of the data from the two sources that exclude those not in the V2 range, a function with a custom or lambda comparator should do this for you if native support doesn’t exist.
Re: Number of forum members online is wrong !
11-12-2017 10:33 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Frontend Web Developer | www.plus.net
If you have an idea to improve the community, create a new topic on our Community Feedback board to start a discussion about your idea.
Re: Number of forum members online is wrong !
11-12-2017 10:34 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Frontend Web Developer | www.plus.net
If you have an idea to improve the community, create a new topic on our Community Feedback board to start a discussion about your idea.

Re: Number of forum members online is wrong !
11-12-2017 10:40 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
I’m confused? These APIs are they both Java for the V1 and V2 data sources? And are the objects returned by these POJOs? If that’s the case then even better from a programming point of view as you’ll be able to unionise these in code using the approach I mentioned above.
Re: Number of forum members online is wrong !
11-12-2017 10:47 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator

My main aim for redeveloping it is to make it a lot faster as its the one component on this site that takes up the most resource. What I will likely do is what you suggest and build a new json string from the two APIs or I could simplify it a little bit.
As well as that I will need to see why the number of online users differs between the two and try and narrow down what makes it think that there is 1 more in the counter than there is in the avatar listing.
Frontend Web Developer | www.plus.net
If you have an idea to improve the community, create a new topic on our Community Feedback board to start a discussion about your idea.

Re: Number of forum members online is wrong !
11-12-2017 11:11 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
As you know a lot of clock cycles are consumed when you’re doing multiple loops i.e. a loop within a loop. Please don’t think I’m teaching you to suck eggs but may I suggest further that when you find an item within your inner loop based on the search conditions of the outer, you remove it from the inner loop’s collection as looking at it again on a subsequent loops it redundant and a waste of time. Also exiting the inner loop at this point can also save time.
As you’re in Java land you could create a custom container class that stores the objects of the user’s you want to display. So again when you find a match within your inner loop you then add the new distinct user to the custom collection class. To take this further you could even create a new (Java) User class, that has sensible defaults in it, and supports multiple constructors. For example default User object instance would have a default outline avatar and any custom avatar could be set using an overloaded constructor.
When you want to use the data in the component you can have it automatically create the required JSON string, and with custom comparators the output can be sorted in any order you need prior to output. OK, I'll stop now.
As for the additional item, could this be related to user’s who hide their online status (like me)?
Re: Number of forum members online is wrong !
11-12-2017 11:29 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
The component code itself cannot be overly complicated with OOP as that just isn't possible. I am basically using freemarker and building the component in a single block so not sure how extensive I can be with creating objects and classes within it.
Frontend Web Developer | www.plus.net
If you have an idea to improve the community, create a new topic on our Community Feedback board to start a discussion about your idea.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Plusnet Community
- :
- Forum
- :
- Feedback
- :
- Community Site Feedback
- :
- Number of forum members online is wrong !