Skip to content

Commit

Permalink
rename heartbeat indexedDB db name because key changed
Browse files Browse the repository at this point in the history
  • Loading branch information
alanhamlett committed Oct 8, 2024
1 parent 7c7f749 commit c1bfd20
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 11 deletions.
8 changes: 0 additions & 8 deletions src/background.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
if (request.task === 'handleActivity') {
if (!sender.tab?.id) return;
Expand Down
2 changes: 1 addition & 1 deletion src/config/config.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ describe('wakatime config', () => {
"chrome://",
"about:",
],
"queueName": "heartbeatQueue",
"queueName": "heartbeatsQueue",
"socialMediaSites": [
"facebook.com",
"instagram.com",
Expand Down
2 changes: 1 addition & 1 deletion src/config/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ const config: Config = {

nonTrackableSites: ['chrome://', 'about:'],

queueName: 'heartbeatQueue',
queueName: 'heartbeatsQueue',

socialMediaSites: [
'facebook.com',
Expand Down
2 changes: 1 addition & 1 deletion src/core/WakaTimeCore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class WakaTimeCore {
* a library that adds promises to IndexedDB and makes it easy to use
*/
async db() {
return openDB('wakatime', 1, {
return openDB('wakatime', 2, {
upgrade(db) {
db.createObjectStore(config.queueName, {
keyPath: 'id',
Expand Down

0 comments on commit c1bfd20

Please sign in to comment.