faameunier / tk-chrome

Tabby (aka project tabkiller) is a Chrome extension that aims at automatically deleting all your useless tabs.
https://www.tabby.us/
0 stars 0 forks source link

tabby stopped working within the switch from Yesterday to Today #106

Closed astronault closed 4 years ago

astronault commented 4 years ago

image

tabby stored +100 tabs from the last 2 days, and the core metric resets to 0 each 24 hours. Yesterday it reset to 0 (as usual). However, this morning, I'm on focus mode and I saw clear tab accumulation on the browser window.

Funny enough, there is the notification that said "8" for 8 tabs removed today. But, when I click on the popup, I see what is above : no sigh of the tabs removed.

image

faameunier commented 4 years ago

We need logs !

Backend logs:

  1. go to chrome://extensions
  2. developer mode on
  3. tabby > view/background.html
  4. console > screenshot all

Frontend logs:

  1. Open the popup
  2. Right click > inspect
  3. console > screenshot all
astronault commented 4 years ago

FRONT END CONSOLE LOGS

image

BACK END CONSOLE LOGS

image

faameunier commented 4 years ago
static async killTab(tabId, tab) {
    try {
      await browser.tabs.remove(parseInt(tabId));
      await memoryManager.updateStatistics(tab); // updating statistics of the tab before removing it from memory
      let copiedTab = copy(tab); // making a simple json copy
      copiedTab.deletion_time = Date.now();
      memoryManager.closed_history.push(copiedTab);
      memoryManager.closed_history = memoryManager.closed_history.slice(0, MAXIMUM_HISTORY_SIZE);
      setUnreadBadge();
      this.retrieveSessionId(tab); // async
      logger('Tab '.concat(tabId, ' killed by policy'));
    } catch (err) {
      logger('Tab '.concat(tabId, " couldn't be killed"));
    }
  }

Slicing should be reversed

faameunier commented 4 years ago

Our dear Arnault likely has 1000 closed tabs. Newly closed tabs are pushed at the end of the history, and slicing removes them. My bad.