CLEARCHAT being sent multiple times

I’ve only experienced this with BTTV, but I’m not sure how widespread it is.

So essentially this is due to how messages are rendered, and is something I’ve been meaning to fix. Messages are received before CLEARCHAT, but are not on the screen when a CLEARCHAT was sent. Because inserts into the DOM and scrolling the chat area down are resource intensive, we batch messages and render them at an interval to prevent chat from freezing up the page. Twitch use to also do this, but has since moved to ember (which binds messages in the DOM to JS). Twitch only runs scrolling down on an interval from what I can tell.

I have been considering swapping to 1 timeout in Nightbot since chat has stabilized now, but I will need to test that mobile clients don’t have such an issue before I make such a change.