From 51e905c66dab75a7feec83b58f769eb1389dc3ef Mon Sep 17 00:00:00 2001 From: alxndrsn Date: Fri, 21 Nov 2025 17:01:52 +0000 Subject: [PATCH 1/2] bump dev dependency: playwright Resolves dependabot warning from https://github.com/apache/pouchdb/pull/9126 --- package-lock.json | 17 +++++++++-------- package.json | 2 +- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/package-lock.json b/package-lock.json index f970755cbd..1a31e5dc78 100644 --- a/package-lock.json +++ b/package-lock.json @@ -53,7 +53,7 @@ "median": "0.0.2", "mocha": "10.8.2", "ncp": "2.0.0", - "playwright": "1.49.1", + "playwright": "1.57.0", "pouchdb-express-router": "0.0.11", "replace": "1.2.1", "rimraf": "2.7.1", @@ -7117,13 +7117,13 @@ } }, "node_modules/playwright": { - "version": "1.49.1", - "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.49.1.tgz", - "integrity": "sha512-VYL8zLoNTBxVOrJBbDuRgDWa3i+mfQgDTrL8Ah9QXZ7ax4Dsj0MSq5bYgytRnDVVe+njoKnfsYkH3HzqVj5UZA==", + "version": "1.57.0", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.57.0.tgz", + "integrity": "sha512-ilYQj1s8sr2ppEJ2YVadYBN0Mb3mdo9J0wQ+UuDhzYqURwSoW4n1Xs5vs7ORwgDGmyEh33tRMeS8KhdkMoLXQw==", "dev": true, "license": "Apache-2.0", "dependencies": { - "playwright-core": "1.49.1" + "playwright-core": "1.57.0" }, "bin": { "playwright": "cli.js" @@ -7136,9 +7136,9 @@ } }, "node_modules/playwright-core": { - "version": "1.49.1", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.49.1.tgz", - "integrity": "sha512-BzmpVcs4kE2CH15rWfzpjzVGhWERJfmnXmniSyKeRZUs9Ws65m+RGIi7mjJK/euCegfn3i7jvqWeWyHe9y3Vgg==", + "version": "1.57.0", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.57.0.tgz", + "integrity": "sha512-agTcKlMw/mjBWOnD6kFZttAAGHgi/Nw0CZ2o6JqWSbMlI219lAFLZZCyqByTsvVAJq5XA5H8cA6PrvBRpBWEuQ==", "dev": true, "license": "Apache-2.0", "bin": { @@ -7154,6 +7154,7 @@ "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", "dev": true, "hasInstallScript": true, + "license": "MIT", "optional": true, "os": [ "darwin" diff --git a/package.json b/package.json index 787cd5d8e8..66f97e7a2c 100644 --- a/package.json +++ b/package.json @@ -82,7 +82,7 @@ "median": "0.0.2", "mocha": "10.8.2", "ncp": "2.0.0", - "playwright": "1.49.1", + "playwright": "1.57.0", "pouchdb-express-router": "0.0.11", "replace": "1.2.1", "rimraf": "2.7.1", From 8b404b500e941e40cbb03dbc99d47cbbe697b2b9 Mon Sep 17 00:00:00 2001 From: alxndrsn Date: Fri, 28 Nov 2025 10:31:11 +0000 Subject: [PATCH 2/2] adapter-idb: fix webkit support --- .../pouchdb-adapter-idb/src/index.js | 17 +++++++++++------ .../src/checkBlobSupport.js | 15 ++++++++++++--- 2 files changed, 23 insertions(+), 9 deletions(-) diff --git a/packages/node_modules/pouchdb-adapter-idb/src/index.js b/packages/node_modules/pouchdb-adapter-idb/src/index.js index 586ca50f03..46b7a313e4 100644 --- a/packages/node_modules/pouchdb-adapter-idb/src/index.js +++ b/packages/node_modules/pouchdb-adapter-idb/src/index.js @@ -712,16 +712,21 @@ function init(api, opts, callback) { cachedDBs.delete(dbName); }; + // First, check blob support. If this is attempted within a shared + // transaction, then on some browsers failure in the blob support + // check may break other requests made in the same transaction. + var blobSupportTx = idb.transaction([ + DETECT_BLOB_SUPPORT_STORE, + ], 'readwrite'); + // Do a few setup operations (in parallel as much as possible): // 1. Fetch meta doc - // 2. Check blob support - // 3. Calculate docCount - // 4. Generate an instanceId if necessary - // 5. Store docCount and instanceId on meta doc + // 2. Calculate docCount + // 3. Generate an instanceId if necessary + // 4. Store docCount and instanceId on meta doc var txn = idb.transaction([ META_STORE, - DETECT_BLOB_SUPPORT_STORE, DOC_STORE ], 'readwrite'); @@ -783,7 +788,7 @@ function init(api, opts, callback) { // if (!blobSupportPromise) { // make sure blob support is only checked once - blobSupportPromise = checkBlobSupport(txn, DETECT_BLOB_SUPPORT_STORE, 'key'); + blobSupportPromise = checkBlobSupport(blobSupportTx, DETECT_BLOB_SUPPORT_STORE, 'key'); } blobSupportPromise.then(function (val) { diff --git a/packages/node_modules/pouchdb-adapter-utils/src/checkBlobSupport.js b/packages/node_modules/pouchdb-adapter-utils/src/checkBlobSupport.js index 233fd2877b..c97be4b3ee 100644 --- a/packages/node_modules/pouchdb-adapter-utils/src/checkBlobSupport.js +++ b/packages/node_modules/pouchdb-adapter-utils/src/checkBlobSupport.js @@ -41,13 +41,22 @@ function checkBlobSupport(txn, store, docIdOrCreateDoc) { parseInt(matchedChrome[1], 10) >= 43); }; - req.onerror = txn.onabort = function (e) { - // If the transaction aborts now its due to not being able to - // write to the database, likely due to the disk being full + txn.onabort = function (e) { + // Historically, if the transaction aborts now its due to not being + // able to write to the database, likely due to the disk being full. + // + // It can also abort due to a change in behaviour on: + // + // * WebKitGTK 2.51.0 (Playwright 1.56.1/webkit-2215) + // * WebKitGTK 2.51.1 (Playwright 1.57.0/webkit-2227) e.preventDefault(); e.stopPropagation(); resolve(false); }; + + req.onerror = function () { + resolve(false); + }; }).catch(function () { return false; // error, so assume unsupported });