Changes
3 changed files (+25/-1)
-
-
@@ -21,7 +21,7 @@ }export async function idbBackend(): Promise<IDBBackend> { return new IDBBackend({ db: await openDB("yamori", 3, { db: await openDB("yamori", 4, { async upgrade(db, oldVersion, _newVersion, transaction, _event) { // v1 if (oldVersion < 1) {
-
@@ -51,6 +51,7 @@await cursor.update({ ...cursor.value, capabilities: { ...cursor.value.capabilities, deletionKey, updateKey, workerAddKey,
-
@@ -72,6 +73,24 @@workers.createIndex("updatedAt", "updatedAt", { unique: false, }); } // v4 if (oldVersion < 4) { const store = transaction.objectStore("workspaces"); for await (const cursor of store.iterate()) { const createLeaveDefinitionKey = new Uint8Array(16); self.crypto.getRandomValues(createLeaveDefinitionKey); await cursor.update({ ...cursor.value, capabilities: { ...cursor.value.capabilities, createLeaveDefinitionKey, }, }); } } }, }),
-
-
-
@@ -15,6 +15,7 @@ capabilities: {deletionKey: Uint8Array; updateKey: Uint8Array; workerAddKey: Uint8Array; createLeaveDefinitionKey: Uint8Array; }; updatedAt: number; };
-
-
-
@@ -65,6 +65,9 @@const workerAddKey = new Uint8Array(16); self.crypto.getRandomValues(workerAddKey); const createLeaveDefinitionKey = new Uint8Array(16); self.crypto.getRandomValues(createLeaveDefinitionKey); let addedKey: IDBValidKey; try {
-
@@ -75,6 +78,7 @@ capabilities: {deletionKey, updateKey, workerAddKey, createLeaveDefinitionKey, }, updatedAt: Date.now(), });
-