Open devmount opened 2 years ago
Thinking about it more, and how the value of thirdstats is likely proportional to mail store size, I'm going to up my recommended default time to 24 hours (once a day).
The automatic background processing is a timer which starts when opening the stats page and is only active as long as the stats page is open. So 24h means you'd have to have your stats page open 24h.
Given that, I think 6h is just fine to reprocess the data at least once on a working day.
The automatic background processing is a timer which starts when opening the stats page
Not possible to register a timer on extension load/init, independent of whether stats is open or not?
In fact it should be possible setting the timer in the background.js, but only if you find a way to call the reprocessing function from outside the Vue instance... I didn't look into that yet, but I'll see what I can do.
Referencing here findings & summary notes (with links and quotes in context) of ~2 hours of research re Thunderbird and Timers. Hope it saves you some time :)
nsITimer
(is XPCOM)WA7: Timers: Current Solution: nsITimer with TYPE_ONE_SHOT New Solution: window.setTimeout(). Also look at chrome.alarms.*
setTimeout
Web API (if the browser compatibility chart lists Firefox, the API also works in Thunderbird)
As Thunderbird is based on Firefox, many of its WebExtension APIs
idle
[x] Automatic thirdstats processing
[x] Only when idle (or locked)
Update-Info from Mozilla: Version 102.2.2, first offered to channel users on September 7, 2022
fixed: Accessing mail folders in profiles with many folders was slow
WindowListener/*
& setTimeout
(in quickfolders-interface.js
)" ...
// async sleep function using Promise
async sleep(delay) {
let timer = Components.classes["@mozilla.org/timer;1"].createInstance(
Components.interfaces.nsITimer
...
Components.interfaces.nsITimer.TYPE_ONE_SHOT
WindowListener
from https://github.com/thundernest/addon-developer-supportThe WindowListener API may only be called from the background page.
Wow thanks! I'll look into that.
Describe the bug
To Reproduce Steps to reproduce the behavior:
Expected behavior Set automatic processing to 6h
Screenshots None
Additional context None