wakatime / browser-wakatime

Chrome extension for automatic time tracking and metrics generated from your browsing activity.
https://wakatime.com
BSD 3-Clause "New" or "Revised" License
420 stars 99 forks source link

Failed to execute 'transaction' on 'IDBDatabase': One of the specified object stores was not found #286

Closed inventor96 closed 1 month ago

inventor96 commented 1 month ago

It looks like after a recent update (~possibly related to #281~ I just realized there was the huge update going to 3.0.24, so I'm less confident it's tied to #281), I'm getting a large number of errors in the Chrome extension. It appears that this is preventing browser time from being logged, as my time per day has dropped by a large margin, and the only network logs for the extension are fetching chrome-extension://jnbbnacmeggbgdjgaoojpmhdlkkpblgi/graphics/wakatime-logo-38-gray.png.

Uncaught (in promise) NotFoundError: Failed to execute 'transaction' on 'IDBDatabase': One of the specified object stores was not found.
    at Proxy.n (index.js:125:26)
    at Proxy.r (index.js:228:25)
    at Object.sendHeartbeats (WakaTimeCore.ts:183:49)
    at async background.ts:12:19
Uncaught (in promise) NotFoundError: Failed to execute 'transaction' on 'IDBDatabase': One of the specified object stores was not found.
    at Proxy.n (index.js:125:26)
    at Proxy.r (index.js:228:25)
    at Object.handleActivity (WakaTimeCore.ts:121:29)
    at async background.ts:39:9

I'm not sure if it's related, but I also see a large handful of these:

Uncaught (in promise) Error: Could not establish connection. Receiving end does not exist.
    at l (browser-polyfill.js:1154:18)

I'm running Brave Browser v1.70.123 (Chromium: 129.0.6668.89), WakaTime extension v4.0.2, using the wakapi.dev backend.

alanhamlett commented 1 month ago

The error Error: Could not establish connection. Receiving end does not exist. I think is because the tab you're browsing needs to be refreshed so the updated extension can re-connect to the tab's context script. I notice that error when developing manually anytime the extension reloads, if I don't refresh a tab.

The other error NotFoundError: Failed to execute 'transaction' on 'IDBDatabase': One of the specified object stores was not found. must be a bug in how we initialize the connection to our local heartbeat queue. I'll get it fixed today, but for now does it work if you reload the extension?

alanhamlett commented 1 month ago

Related to #280, and fixed with 7643c6848d7ac595b9c1585d046fde0008da2c7c released in v4.0.3.

alanhamlett commented 1 month ago

I've renamed the IndexedDB database and bumped the db version so it's re-created fresh in v4.0.4. Does that fix it?