The batching takes place every 20seconds and the result gets cached server-side. This leads to users joining after 19 seconds since the last batch getting an inaccurate list of users until the next batching. But the caveat here is even with the next batch of events the userlist can still be inaccurate.

This has been brought up to twitch's dev team and they've stated it has to do with maintaining states of the various client types(IRC, browser, Websockets). More to this is the web endpoint to get the current userlist will reflect exactly what mIRC has in the nicklist assuming mIRC has had enough time to receive a full set of batched events.

Twitch's dev team has stated the userlist should not be depended on. Instead, its recommended that bots use the IRCv3 msgtags sent with each message to determine a user's state(channel/stream owner, mod, sub, etc) over relying on a client's userlist. This does not take into account things that depend on an accurate userlist such as giveaways or point systems. Twitch has stated that it effects very few users in the global scope of things to be worth the time and resources to alter.

--

Here is a prime example cut straight from my buffer of how the userlist can become inaccurate. Notice that 2 minutes after I join, Twitch(jtv) removes my mode for no reason. I didn't get de-oped, disconnect or part, nor did I have a secondary client logged in under the account enter/leave the chat, etc. Then with a subsequent set of batched events it gives op status back to me.
Code:
02:35@06/14 * Attempting to rejoin channel #mirchelp
02:35@06/14 * sreject(sreject@sreject.tmi.twitch.tv) has joined.
02:35@06/14 * jtv has set mode: +o sreject
02:37@06/14 * jtv has set mode: -o sreject
02:38@06/14 * jtv has set mode: +o sreject


This also happens with join and part events, apparently for no reason. Furthermore, the inaccuracy can span multiple batch sets before its rectified if it does at all. My bot in the channel hasn't been in the nicklist(due to a part event) for, what I can tell, 6hrs even though it has been connected and in the room the entire time.


Last edited by FroggieDaFrog; 14/06/16 10:00 PM.