rename heartbeat indexedDB db name because key changed

This commit is contained in:
Alan Hamlett
2024-10-08 14:13:34 +02:00
parent 7c7f749c71
commit c1bfd20053
4 changed files with 3 additions and 11 deletions

View File

@@ -60,14 +60,6 @@ browser.tabs.onUpdated.addListener(async (tabId, changeInfo) => {
} }
}); });
/**
* Creates IndexedDB
* https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API
*/
self.addEventListener('activate', async () => {
await WakaTimeCore.db();
});
browser.runtime.onMessage.addListener(async (request: { task: string }, sender) => { browser.runtime.onMessage.addListener(async (request: { task: string }, sender) => {
if (request.task === 'handleActivity') { if (request.task === 'handleActivity') {
if (!sender.tab?.id) return; if (!sender.tab?.id) return;

View File

@@ -58,7 +58,7 @@ describe('wakatime config', () => {
"chrome://", "chrome://",
"about:", "about:",
], ],
"queueName": "heartbeatQueue", "queueName": "heartbeatsQueue",
"socialMediaSites": [ "socialMediaSites": [
"facebook.com", "facebook.com",
"instagram.com", "instagram.com",

View File

@@ -164,7 +164,7 @@ const config: Config = {
nonTrackableSites: ['chrome://', 'about:'], nonTrackableSites: ['chrome://', 'about:'],
queueName: 'heartbeatQueue', queueName: 'heartbeatsQueue',
socialMediaSites: [ socialMediaSites: [
'facebook.com', 'facebook.com',

View File

@@ -27,7 +27,7 @@ class WakaTimeCore {
* a library that adds promises to IndexedDB and makes it easy to use * a library that adds promises to IndexedDB and makes it easy to use
*/ */
async db() { async db() {
return openDB('wakatime', 1, { return openDB('wakatime', 2, {
upgrade(db) { upgrade(db) {
db.createObjectStore(config.queueName, { db.createObjectStore(config.queueName, {
keyPath: 'id', keyPath: 'id',