Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Periodic Processing too often #381

Open
devmount opened this issue Sep 16, 2022 · 6 comments
Open

Periodic Processing too often #381

devmount opened this issue Sep 16, 2022 · 6 comments
Labels
bug Something isn't working or feels broken good first issue Good for newcomers

Comments

@devmount
Copy link
Owner

Describe the bug

image

To Reproduce
Steps to reproduce the behavior:

  1. Update to ThirdStats 1.9.0 after updating to this version
  2. Open add-on options
  3. See automatic processing being set to only 5min

Expected behavior
Set automatic processing to 6h

Screenshots
None

Additional context
None

@devmount devmount added bug Something isn't working or feels broken good first issue Good for newcomers labels Sep 16, 2022
@koobs
Copy link
Contributor

koobs commented Sep 16, 2022

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).

@devmount
Copy link
Owner Author

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.

@koobs
Copy link
Contributor

koobs commented Sep 17, 2022

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?

@devmount
Copy link
Owner Author

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.

@koobs
Copy link
Contributor

koobs commented Sep 18, 2022

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 :)

tldr appears to be:

  • nsItimer
  • setTimeout()
  • Experiments API ( + wrappers)

Search: nsITimer (is XPCOM)

AdBlockPlus Issue 7375 - Replace Ci.nsITimer with setTimeout()

TorBrowser: Investigate new WebExtensions API requirements for our extensions

WA7: Timers: Current Solution: nsITimer with TYPE_ONE_SHOT New Solution: window.setTimeout(). Also look at chrome.alarms.*

Search setTimeout

Search idle

[x] Automatic thirdstats processing
   [x] Only when idle (or locked)

Thunderbird 102 supporting addon: Quick Folders

QuickFolders apparently supports 102 (issue above is performance issue on 102)

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

QuickFolders uses Timers (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

The WindowListener API may only be called from the background page.

@devmount
Copy link
Owner Author

Wow thanks! I'll look into that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working or feels broken good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants