Mephiles / torntools_extension

A browser extension for Torn.com
GNU General Public License v3.0
106 stars 60 forks source link

Essential user data sync set to 30 seconds but it isn't syncing #799

Closed iarp closed 3 weeks ago

iarp commented 3 weeks ago

Firefox 127.0, TT Version 7.2.2

I can't figure out how to force it to check right now. Going to API and then Force Update is not updating the popup but it does register the api hit on the chart below the button. The chart also shows 3 Torn hits every hour. My API Usage is set to 30/120/30

image

Sashank999 commented 3 weeks ago

Along with other issues regarding cross browser compatibility, I came to know that alarms API, which should be used to set the data updaters, do not persist across browser sessions in Firefox unlike Chrome.

Currently a workaround is to manually add the alarms manually. Note that this will work until you close the browser. Steps:

  1. Open TornTools settings page.
  2. Press F12, which opens the Inspector window (or pane).
  3. In the Console tab, paste the following code:
    await chrome.alarms.create("notifications-alarm", { periodInMinutes: 0.52 });
    await chrome.alarms.create("clear-cache-alarm", { periodInMinutes: 60 });
    await chrome.alarms.create("clear-usage-alarm", { periodInMinutes: 60 * 24 });
    await chrome.alarms.create("data-update-alarm", { periodInMinutes: 0.52 });

    and press Enter.

We have fixed this in 9022fad and will be releasing it soon. There is also a new option to force reset those timers added in 59242b29677a787656fa51b08496c794d83310b1 in the new version.