Periodic MUC self ping #21

Open mrry.band
targeting main
Open opened by and assigned to mrry.band
targeting main

The basics of how it works is that ChannelPinger keeps a map of known channels and when they should be pinged next. When we successfully join a channel we add it to the schedule to be pinged in 5 minutes and then everytime activity comes in for that channel that indicates we still have a connection we push the timer out 5 minutes again.

Every one minute we check if there are any channels that are past due for a ping and send those ones.

When we successfully self ping a channel we schedule the next ping at that time.

When we leave a channel we remove the channel from the scheduler so we stop pinging it.

When we're going to send a Stanza we look if any channels should be pinged in the next 30 seconds, and if so send all that would be pinged in the next 60 seconds (previously decided rules, but easy to change if we change our mind).

Having startTimer twice because of resuming/fresh session and stopTimer twice because of stream offline/user logout seems like a smell to me that there isn't a shared initialization, but I'm not sure if there's enough to do something about it now. Open to suggestions/ideas there.

I added filter to borogove map because this does exist on haxe's map, but I could only run haxe testjs.hxml after adding to borogove map (haxe test.hxml ran fine without).

Similarly I had to add a return type annotation to OMEMO.hx because something caused it to start inferring the wrong thing.

This pull request has no versions submitted yet.