Closed KyleMaas closed 3 years ago
I think this should fix #114
Does this look like a reasonable way to do it?
Changed
Thanks :)
Have you had a chance to try this out yet and see how it works for you? Because if this method is suitable, I'd like to try to apply it to Private, Thread, and Channel as well. If it isn't, I'd like to file an issue so I know what needs work.
Seems to be working much better now
Cool. Then I will see if I can get this implemented on the other pages for consistency.
Instead of figuring out autorefresh on the Public tab, this version does it the new-public-messages component. The idea is that when a new message comes in, it checks to see if autorefresh is enabled and, if so, refreshes. But then it blocks autorefreshing for 30 seconds. At the end of that timer, it rechecks in case a message came in while it was blocked, and then it unblocks autorefreshing so the next message can refresh immediately.
The reason for the timer is because when you're doing a major sync operation it could otherwise trigger a whole bunch of refresh requests in a very short amount of time (it did this the first time I tried it). So I think we still need a timer, but it needs to block instead of being the primary motivation for action.
So, does that look like an acceptable way to do it?