From feb2a8995ff7eac12f2987cc54609b9be2ed23b7 Mon Sep 17 00:00:00 2001 From: anvmn Date: Tue, 15 Oct 2024 15:19:30 +0300 Subject: [PATCH 1/3] Update Dexie to v3.2.7 --- client/bower.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/bower.json b/client/bower.json index a06be1fbb5..5c54df6bc3 100644 --- a/client/bower.json +++ b/client/bower.json @@ -13,7 +13,7 @@ "dependencies": { "copy-button": "sudodoki/copy-button#2.0.0", "dropzone": "5.7.0", - "dexie": "3.2.4", + "dexie": "3.2.7", "exif-js": "2.3.0", "semantic": "semantic-ui#2.2.1" } From 8e0006327a2da77f9f2ce1fab7999d112faa4f8f Mon Sep 17 00:00:00 2001 From: anvmn Date: Tue, 15 Oct 2024 19:44:26 +0300 Subject: [PATCH 2/3] Fix argument passed to db.transaction [ci skip] --- client/src/js/nodes.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/client/src/js/nodes.js b/client/src/js/nodes.js index 48dbd9146b..b41567df71 100644 --- a/client/src/js/nodes.js +++ b/client/src/js/nodes.js @@ -343,11 +343,12 @@ return addShard.then(function (json) { return table.put(json).catch(databaseError).then(function () { return sendRevisedNode(table, uuid).then(function () { + var tableName = table.name; // For hooks to be able to work, we need to declare the // tables that may be altered due to a change. In this case // We want to allow adding pending upload photos. // See for example dbSync.nodeChanges.hook(). - return db.transaction('rw', table, dbSync.nodeChanges, dbSync.shardChanges, dbSync.authorityPhotoUploadChanges, function() { + return db.transaction('rw', tableName, dbSync.nodeChanges, dbSync.shardChanges, dbSync.authorityPhotoUploadChanges, function() { var body = JSON.stringify({ data: [json] }); @@ -372,7 +373,7 @@ var changeTable = dbSync.nodeChanges; - if (table === dbSync.shards) { + if (tableName === 'shards') { changeTable = dbSync.shardChanges; change.shard = json.shard; } From 686e3513f59a19d42e67d9b11cd402cd86ace0b9 Mon Sep 17 00:00:00 2001 From: anvmn Date: Tue, 15 Oct 2024 19:55:21 +0300 Subject: [PATCH 3/3] Apply fix for PATCH as well --- client/src/js/nodes.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/client/src/js/nodes.js b/client/src/js/nodes.js index b41567df71..4abf179c80 100644 --- a/client/src/js/nodes.js +++ b/client/src/js/nodes.js @@ -246,7 +246,8 @@ // tables that may be altered due to a change. In this case // We want to allow adding pending upload photos. // See for example dbSync.nodeChanges.hook(). - return db.transaction('rw', table, dbSync.nodeChanges, dbSync.shardChanges, dbSync.authorityPhotoUploadChanges, function() { + var tableName = table.name; + return db.transaction('rw', tableName, dbSync.nodeChanges, dbSync.shardChanges, dbSync.authorityPhotoUploadChanges, function() { return table.get(uuid).catch(databaseError).then(function (node) { if (node) { var body = JSON.stringify({ @@ -274,7 +275,7 @@ var changeTable = dbSync.nodeChanges; var addShard = Promise.resolve(); - if (table === dbSync.shards) { + if (tableName === 'shards') { changeTable = dbSync.shardChanges; addShard = table.get(uuid).catch(databaseError).then(function (item) { @@ -343,7 +344,7 @@ return addShard.then(function (json) { return table.put(json).catch(databaseError).then(function () { return sendRevisedNode(table, uuid).then(function () { - var tableName = table.name; + var tableName = table.name; // For hooks to be able to work, we need to declare the // tables that may be altered due to a change. In this case // We want to allow adding pending upload photos.