Add long polling to update unread counts in navbar.
Currently have this set to 30 seconds, either that or 1m seems good.
I saw unread messages, reports, and applications getting polling. Is there one needed for replies as well?
unreadInboxCount includes unread replies, messages, and mentions.
Sorry, I realized that I was commenting on #1148 when I meant to comment here 🤦 moving my comment:
Many users will have tens (in some cases even hundreds) of tabs open, so it could be extremely useful to either A) completely pause polling or B) just skip invoking the promiseFn in your poll function, whenever document.visibilityState != "visible"
For example with the 30 second polling:
If an instance has an average of 1000 users who leave 100 tabs open in the background, then not pausing background polling will generate 288 000 000 extra unnecessary http requests in a day (1000 users * 100 tabs * 2880 requests in a tab per 24h)
@sunaurus I recall you linked a browser API that can be used to avoid this problem in the issue comments.
Yep, it's here: https://developer.mozilla.org/en-US/docs/Web/API/Document/visibilityState