Open ekimekim opened 2 weeks ago
Chat can sometimes take a really long time to render (this is why we put it off to a background worker). How long of ranges/much chat was this tested on? Should we do this less frequently than 10 seconds?
This was not tested.
My hope was that it would be frequent enough for someone watching live. If that's not feasible without a smart "what changed" algorithm, we can do without.
I just remembered this also: Doesn't the server-side chat functionality only update with new chat once per minute?
Yes, chat_archiver only writes out chat to disk once a minute, and even that is on a minute or so's delay.
This won't fix that the chat archiver only updates once per minute, but I believe I've made the chat handling much faster in the SolidJS version (I keep the state progress that videoHumanTimeFromDateTime
recalculates for every chat message in the current version).
If the chat_archiver thing can be resolved, the SolidJS scheduled package may be of interest. (Even if it can't, we could use that and pull on a longer basis, say, 30-60 seconds.)
We request current time + 1 minute, and re-request every 10 seconds.
If I'm reading the code correctly, everything already correctly handles the chat being replaced by a new fetch (as though we loaded a new video range).