Upgrade async package to 3.2.2 (#8447)

* Revert "Revert "Bump async to 3.2.2 (#7618)""

This reverts commit 75153a555211d654744c2e61e27fe21085826c22.

* [web] fix usage of async.queue.drain in script

* [clsi] fix usage of async.queue.drain

* [spelling] fix usage of async.queue.drain

* [redis-wrapper] fix usage of async.queue.drain

* [web] Test that LockManager queue is cleared

This protects against a regression found when upgrading the
async package. Here we test that the `queue.drain` callback
is really getting called, and the lock is being removed from
the LOCK_QUEUES map.

* [redis-wrapper] Upgrade async to 3.2.2

GitOrigin-RevId: df921e6d7f1d505bd467f22e58600ba1aff48869
This commit is contained in:
June Kelly 2022-06-21 09:07:14 +01:00 committed by Copybot
parent 1c78e211f6
commit a450a74351
23 changed files with 118 additions and 326 deletions

View file

@ -137,7 +137,9 @@ module.exports = class RedisWebLocker {
queue = async.queue(handler, 1)
queue.push(task)
// remove the queue object when queue is empty
queue.drain = () => LOCK_QUEUES.delete(queueName)
queue.drain(() => {
LOCK_QUEUES.delete(queueName)
})
// store the queue in our global map
LOCK_QUEUES.set(queueName, queue)
} else {
@ -189,4 +191,8 @@ module.exports = class RedisWebLocker {
}
})
}
_lockQueuesSize() {
return LOCK_QUEUES.size
}
}

View file

@ -26,13 +26,13 @@
"@overleaf/o-error": "^3.4.0"
},
"dependencies": {
"ioredis": "~4.27.1",
"async": "0.6.2"
"async": "^3.2.2",
"ioredis": "~4.27.1"
},
"devDependencies": {
"@overleaf/logger": "*",
"@overleaf/o-error": "^3.4.0",
"chai": "^4.3.6",
"@overleaf/logger": "*",
"mocha": "^8.4.0",
"sandboxed-module": "^2.0.4",
"sinon": "^9.2.4"

318
package-lock.json generated
View file

@ -946,7 +946,7 @@
"version": "2.1.0",
"license": "ISC",
"dependencies": {
"async": "0.6.2",
"async": "^3.2.2",
"ioredis": "~4.27.1"
},
"devDependencies": {
@ -963,11 +963,6 @@
"@overleaf/o-error": "^3.4.0"
}
},
"libraries/redis-wrapper/node_modules/async": {
"version": "0.6.2",
"resolved": "https://registry.npmjs.org/async/-/async-0.6.2.tgz",
"integrity": "sha512-fWbn+CMBgn1KOL/UvYdsmH+gMN/fW+lzAoadt4VUFvB/t0pB4aY9RfRCCvhoA58jocHyYm5TGbeuZsPc9i1Cpg=="
},
"libraries/settings": {
"name": "@overleaf/settings",
"version": "3.0.0"
@ -7370,9 +7365,9 @@
}
},
"node_modules/async": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/async/-/async-3.2.0.tgz",
"integrity": "sha512-TR2mEZFVOj2pLStYxLht7TyfuRzaydfpxr3k9RpHIzMgw7A64dzsdqCxH1WJyQdoe8T10nDXd9wnEigmiuHIZw=="
"version": "3.2.2",
"resolved": "https://registry.npmjs.org/async/-/async-3.2.2.tgz",
"integrity": "sha512-H0E+qZaDEfx/FY4t7iLRv1W2fFI6+pyCeTw1uN20AQPiwqwM6ojPxHxdLv4z8hi2DtnW9BOckSspLucW7pIE5g=="
},
"node_modules/async-limiter": {
"version": "1.0.1",
@ -32081,7 +32076,7 @@
"@overleaf/logger": "^3.1.0",
"@overleaf/metrics": "^4.0.0",
"@overleaf/settings": "^3.0.0",
"async": "^3.2.0",
"async": "^3.2.2",
"body-parser": "^1.19.0",
"express": "4.17.1",
"mongodb": "^3.6.0"
@ -32098,6 +32093,11 @@
"timekeeper": "^2.2.0"
}
},
"services/chat/node_modules/async": {
"version": "3.2.3",
"resolved": "https://registry.npmjs.org/async/-/async-3.2.3.tgz",
"integrity": "sha512-spZRyzKL5l5BZQrr/6m/SqFdBN0q3OCI0f9rjfBzCMBIP4p75P620rR3gTmaksNOhmzgdxcaxdNfMy6anrbM0g=="
},
"services/chat/node_modules/body-parser": {
"version": "1.19.0",
"resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.0.tgz",
@ -32318,7 +32318,7 @@
"@overleaf/metrics": "^4.0.0",
"@overleaf/o-error": "^3.4.0",
"@overleaf/settings": "^3.0.0",
"async": "3.2.0",
"async": "3.2.2",
"body-parser": "^1.19.0",
"bunyan": "^1.8.15",
"diskusage": "^1.1.3",
@ -32418,7 +32418,7 @@
"@overleaf/logger": "^3.1.0",
"@overleaf/metrics": "^4.0.0",
"@overleaf/settings": "^3.0.0",
"async": "^2.6.3",
"async": "^3.2.2",
"body-parser": "^1.19.0",
"bunyan": "^1.8.15",
"express": "^4.17.1",
@ -32435,14 +32435,6 @@
"timekeeper": "2.2.0"
}
},
"services/contacts/node_modules/async": {
"version": "2.6.3",
"resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz",
"integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==",
"dependencies": {
"lodash": "^4.17.14"
}
},
"services/contacts/node_modules/diff": {
"version": "4.0.2",
"resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz",
@ -32491,7 +32483,7 @@
"@overleaf/o-error": "^3.4.0",
"@overleaf/object-persistor": "^1.0.1",
"@overleaf/settings": "^3.0.0",
"async": "^2.6.3",
"async": "^3.2.2",
"body-parser": "^1.19.0",
"bunyan": "^1.8.15",
"celebrate": "^13.0.4",
@ -32545,14 +32537,6 @@
"node": ">=10"
}
},
"services/docstore/node_modules/async": {
"version": "2.6.3",
"resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz",
"integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==",
"dependencies": {
"lodash": "^4.17.14"
}
},
"services/docstore/node_modules/celebrate": {
"version": "13.0.4",
"resolved": "https://registry.npmjs.org/celebrate/-/celebrate-13.0.4.tgz",
@ -32674,7 +32658,7 @@
"@overleaf/o-error": "^3.4.0",
"@overleaf/redis-wrapper": "^2.0.1",
"@overleaf/settings": "^3.0.0",
"async": "^2.5.0",
"async": "^3.2.2",
"body-parser": "^1.19.0",
"bunyan": "^1.8.15",
"diff-match-patch": "https://github.com/overleaf/diff-match-patch/archive/89805f9c671a77a263fc53461acd62aa7498f688.tar.gz",
@ -32694,14 +32678,6 @@
"timekeeper": "^2.0.0"
}
},
"services/document-updater/node_modules/async": {
"version": "2.6.3",
"resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz",
"integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==",
"dependencies": {
"lodash": "^4.17.14"
}
},
"services/document-updater/node_modules/body-parser": {
"version": "1.19.0",
"resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.0.tgz",
@ -33097,7 +33073,7 @@
"@overleaf/metrics": "^4.0.0",
"@overleaf/o-error": "^3.4.0",
"@overleaf/settings": "^3.0.0",
"async": "^2.6.3",
"async": "^3.2.2",
"base64-stream": "^0.1.2",
"body-parser": "^1.19.0",
"bunyan": "^1.8.15",
@ -33118,14 +33094,6 @@
"timekeeper": "2.2.0"
}
},
"services/github-sync/node_modules/async": {
"version": "2.6.3",
"resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz",
"integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==",
"dependencies": {
"lodash": "^4.17.14"
}
},
"services/github-sync/node_modules/p-limit": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz",
@ -33379,7 +33347,7 @@
"@overleaf/logger": "^3.1.0",
"@overleaf/metrics": "^4.0.0",
"@overleaf/settings": "^3.0.0",
"async": "^2.6.3",
"async": "^3.2.2",
"body-parser": "^1.19.0",
"bunyan": "^1.8.15",
"express": "4.17.1",
@ -33396,14 +33364,6 @@
"sinon": "^9.2.4"
}
},
"services/notifications/node_modules/async": {
"version": "2.6.3",
"resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz",
"integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==",
"dependencies": {
"lodash": "^4.17.14"
}
},
"services/notifications/node_modules/body-parser": {
"version": "1.19.0",
"resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.0.tgz",
@ -33630,7 +33590,7 @@
"@overleaf/metrics": "^4.0.0",
"@overleaf/settings": "^3.0.0",
"archiver": "^5.3.0",
"async": "^2.6.3",
"async": "^3.2.2",
"body-parser": "^1.19.0",
"bunyan": "^1.8.15",
"express": "^4.17.1",
@ -33677,14 +33637,6 @@
"node": ">=10"
}
},
"services/project-archiver/node_modules/async": {
"version": "2.6.3",
"resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz",
"integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==",
"dependencies": {
"lodash": "^4.17.14"
}
},
"services/project-archiver/node_modules/date-and-time": {
"version": "0.14.2",
"resolved": "https://registry.npmjs.org/date-and-time/-/date-and-time-0.14.2.tgz",
@ -33775,7 +33727,7 @@
"@overleaf/o-error": "^3.4.0",
"@overleaf/redis-wrapper": "^2.0.0",
"@overleaf/settings": "^3.0.0",
"async": "^2.5.0",
"async": "^3.2.2",
"aws-sdk": "^2.650.0",
"bluebird": "^3.7.2",
"body-parser": "^1.19.0",
@ -33838,14 +33790,6 @@
"@hapi/hoek": "^8.3.0"
}
},
"services/project-history/node_modules/async": {
"version": "2.6.3",
"resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz",
"integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==",
"dependencies": {
"lodash": "^4.17.14"
}
},
"services/project-history/node_modules/body-parser": {
"version": "1.19.0",
"resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.0.tgz",
@ -34199,7 +34143,7 @@
"@overleaf/o-error": "^3.4.0",
"@overleaf/redis-wrapper": "^2.0.0",
"@overleaf/settings": "^3.0.0",
"async": "^0.9.0",
"async": "^3.2.2",
"base64id": "0.1.0",
"body-parser": "^1.19.0",
"bunyan": "^1.8.15",
@ -34224,11 +34168,6 @@
"uid-safe": "^2.1.5"
}
},
"services/real-time/node_modules/async": {
"version": "0.9.2",
"resolved": "https://registry.npmjs.org/async/-/async-0.9.2.tgz",
"integrity": "sha1-rqdNXmHB+JlhO/ZL2mbUx48v0X0="
},
"services/real-time/node_modules/sandboxed-module": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/sandboxed-module/-/sandboxed-module-0.3.0.tgz",
@ -34267,7 +34206,7 @@
"@overleaf/o-error": "^3.4.0",
"@overleaf/redis-wrapper": "^2.0.0",
"@overleaf/settings": "^3.0.0",
"async": "^2.1.2",
"async": "^3.2.2",
"body-parser": "^1.19.0",
"bunyan": "^1.8.15",
"express": "^4.17.1",
@ -34286,14 +34225,6 @@
"sinon": "^9.2.4"
}
},
"services/references/node_modules/async": {
"version": "2.6.3",
"resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz",
"integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==",
"dependencies": {
"lodash": "^4.17.14"
}
},
"services/references/node_modules/uuid": {
"version": "7.0.3",
"resolved": "https://registry.npmjs.org/uuid/-/uuid-7.0.3.tgz",
@ -34310,7 +34241,7 @@
"@overleaf/metrics": "^4.0.0",
"@overleaf/o-error": "^3.4.0",
"@overleaf/settings": "^3.0.0",
"async": "^2.6.3",
"async": "^3.2.2",
"body-parser": "^1.19.0",
"bunyan": "^1.8.15",
"express": "^4.17.1",
@ -34327,14 +34258,6 @@
"sinon": "^9.2.4"
}
},
"services/spelling/node_modules/async": {
"version": "2.6.3",
"resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz",
"integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==",
"dependencies": {
"lodash": "^4.17.14"
}
},
"services/spelling/node_modules/underscore": {
"version": "1.13.1",
"resolved": "https://registry.npmjs.org/underscore/-/underscore-1.13.1.tgz",
@ -34348,7 +34271,7 @@
"@overleaf/settings": "^3.0.0",
"algolia-search": "~1.5.5",
"args-js": "0.10.12",
"async": "3.2.0",
"async": "3.2.2",
"body-parser": "^1.19.0",
"bunyan": "^1.8.15",
"express": "4.17.1",
@ -34594,7 +34517,7 @@
"@overleaf/o-error": "^3.4.0",
"@overleaf/redis-wrapper": "^2.0.1",
"@overleaf/settings": "^3.0.0",
"async": "^2.6.3",
"async": "^3.2.2",
"body-parser": "^1.19.0",
"bunyan": "^1.8.15",
"dropbox": "^10.24.0",
@ -34616,14 +34539,6 @@
"sinon-stub-promise": "^4.0.0"
}
},
"services/third-party-datastore/node_modules/async": {
"version": "2.6.3",
"resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz",
"integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==",
"dependencies": {
"lodash": "^4.17.14"
}
},
"services/third-party-datastore/node_modules/diff": {
"version": "4.0.2",
"resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz",
@ -34695,7 +34610,7 @@
"@overleaf/metrics": "^4.0.0",
"@overleaf/o-error": "^3.4.0",
"@overleaf/settings": "^3.0.0",
"async": "^2.6.3",
"async": "^3.2.2",
"body-parser": "^1.19.0",
"bunyan": "^1.8.15",
"express": "^4.17.1",
@ -34715,14 +34630,6 @@
"sinon-chai": "^3.7.0"
}
},
"services/third-party-references/node_modules/async": {
"version": "2.6.3",
"resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz",
"integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==",
"dependencies": {
"lodash": "^4.17.14"
}
},
"services/third-party-references/node_modules/diff": {
"version": "4.0.2",
"resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz",
@ -34798,7 +34705,7 @@
"@overleaf/o-error": "^3.4.0",
"@overleaf/redis-wrapper": "^2.0.0",
"@overleaf/settings": "^3.0.0",
"async": "^2.6.3",
"async": "^3.2.2",
"aws-sdk": "^2.643.0",
"body-parser": "^1.19.0",
"bson": "^1.1.5",
@ -34829,14 +34736,6 @@
"timekeeper": "2.2.0"
}
},
"services/track-changes/node_modules/async": {
"version": "2.6.3",
"resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz",
"integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==",
"dependencies": {
"lodash": "^4.17.14"
}
},
"services/track-changes/node_modules/body-parser": {
"version": "1.19.0",
"resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.0.tgz",
@ -35146,7 +35045,7 @@
"angular": "~1.8.0",
"angular-sanitize": "~1.8.0",
"archiver": "^5.3.0",
"async": "0.6.2",
"async": "3.2.2",
"backbone": "^1.3.3",
"basic-auth": "^2.0.1",
"bcrypt": "^5.0.0",
@ -35429,11 +35328,6 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
"services/web/node_modules/async": {
"version": "0.6.2",
"resolved": "https://registry.npmjs.org/async/-/async-0.6.2.tgz",
"integrity": "sha1-Qf0DijgSwKi8GELs8IumPrA5K+8="
},
"services/web/node_modules/body-parser": {
"version": "1.19.0",
"resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.0.tgz",
@ -40108,7 +40002,7 @@
"@overleaf/settings": "^3.0.0",
"acorn": "^7.1.1",
"ajv": "^6.12.0",
"async": "^3.2.0",
"async": "^3.2.2",
"body-parser": "^1.19.0",
"chai": "^4.3.6",
"chai-as-promised": "^7.1.1",
@ -40121,6 +40015,11 @@
"timekeeper": "^2.2.0"
},
"dependencies": {
"async": {
"version": "3.2.3",
"resolved": "https://registry.npmjs.org/async/-/async-3.2.3.tgz",
"integrity": "sha512-spZRyzKL5l5BZQrr/6m/SqFdBN0q3OCI0f9rjfBzCMBIP4p75P620rR3gTmaksNOhmzgdxcaxdNfMy6anrbM0g=="
},
"body-parser": {
"version": "1.19.0",
"resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.0.tgz",
@ -40306,7 +40205,7 @@
"@overleaf/metrics": "^4.0.0",
"@overleaf/o-error": "^3.4.0",
"@overleaf/settings": "^3.0.0",
"async": "3.2.0",
"async": "3.2.2",
"body-parser": "^1.19.0",
"bunyan": "^1.8.15",
"chai": "^4.3.6",
@ -40393,7 +40292,7 @@
"@overleaf/logger": "^3.1.0",
"@overleaf/metrics": "^4.0.0",
"@overleaf/settings": "^3.0.0",
"async": "^2.6.3",
"async": "^3.2.2",
"body-parser": "^1.19.0",
"bunyan": "^1.8.15",
"chai": "^4.3.6",
@ -40408,14 +40307,6 @@
"underscore": "~1.13.1"
},
"dependencies": {
"async": {
"version": "2.6.3",
"resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz",
"integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==",
"requires": {
"lodash": "^4.17.14"
}
},
"diff": {
"version": "4.0.2",
"resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz",
@ -40457,7 +40348,7 @@
"@overleaf/o-error": "^3.4.0",
"@overleaf/object-persistor": "^1.0.1",
"@overleaf/settings": "^3.0.0",
"async": "^2.6.3",
"async": "^3.2.2",
"body-parser": "^1.19.0",
"bunyan": "^1.8.15",
"celebrate": "^13.0.4",
@ -40505,14 +40396,6 @@
"xdg-basedir": "^4.0.0"
}
},
"async": {
"version": "2.6.3",
"resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz",
"integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==",
"requires": {
"lodash": "^4.17.14"
}
},
"celebrate": {
"version": "13.0.4",
"resolved": "https://registry.npmjs.org/celebrate/-/celebrate-13.0.4.tgz",
@ -40611,7 +40494,7 @@
"@overleaf/o-error": "^3.4.0",
"@overleaf/redis-wrapper": "^2.0.1",
"@overleaf/settings": "^3.0.0",
"async": "^2.5.0",
"async": "^3.2.2",
"body-parser": "^1.19.0",
"bunyan": "^1.8.15",
"chai": "^4.3.6",
@ -40629,14 +40512,6 @@
"timekeeper": "^2.0.0"
},
"dependencies": {
"async": {
"version": "2.6.3",
"resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz",
"integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==",
"requires": {
"lodash": "^4.17.14"
}
},
"body-parser": {
"version": "1.19.0",
"resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.0.tgz",
@ -40966,7 +40841,7 @@
"@overleaf/metrics": "^4.0.0",
"@overleaf/o-error": "^3.4.0",
"@overleaf/settings": "^3.0.0",
"async": "^2.6.3",
"async": "^3.2.2",
"base64-stream": "^0.1.2",
"body-parser": "^1.19.0",
"bunyan": "^1.8.15",
@ -40985,14 +40860,6 @@
"timekeeper": "2.2.0"
},
"dependencies": {
"async": {
"version": "2.6.3",
"resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz",
"integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==",
"requires": {
"lodash": "^4.17.14"
}
},
"p-limit": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz",
@ -41151,7 +41018,7 @@
"@overleaf/logger": "^3.1.0",
"@overleaf/metrics": "^4.0.0",
"@overleaf/settings": "^3.0.0",
"async": "^2.6.3",
"async": "^3.2.2",
"body-parser": "^1.19.0",
"bunyan": "^1.8.15",
"chai": "^4.3.6",
@ -41166,14 +41033,6 @@
"underscore": "1.13.1"
},
"dependencies": {
"async": {
"version": "2.6.3",
"resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz",
"integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==",
"requires": {
"lodash": "^4.17.14"
}
},
"body-parser": {
"version": "1.19.0",
"resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.0.tgz",
@ -41479,7 +41338,7 @@
"@overleaf/metrics": "^4.0.0",
"@overleaf/settings": "^3.0.0",
"archiver": "^5.3.0",
"async": "^2.6.3",
"async": "^3.2.2",
"body-parser": "^1.19.0",
"bunyan": "^1.8.15",
"chai": "^4.3.6",
@ -41521,14 +41380,6 @@
"xdg-basedir": "^4.0.0"
}
},
"async": {
"version": "2.6.3",
"resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz",
"integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==",
"requires": {
"lodash": "^4.17.14"
}
},
"date-and-time": {
"version": "0.14.2",
"resolved": "https://registry.npmjs.org/date-and-time/-/date-and-time-0.14.2.tgz",
@ -41602,7 +41453,7 @@
"@overleaf/o-error": "^3.4.0",
"@overleaf/redis-wrapper": "^2.0.0",
"@overleaf/settings": "^3.0.0",
"async": "^2.5.0",
"async": "^3.2.2",
"aws-sdk": "^2.650.0",
"bluebird": "^3.7.2",
"body-parser": "^1.19.0",
@ -41660,14 +41511,6 @@
"@hapi/hoek": "^8.3.0"
}
},
"async": {
"version": "2.6.3",
"resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz",
"integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==",
"requires": {
"lodash": "^4.17.14"
}
},
"body-parser": {
"version": "1.19.0",
"resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.0.tgz",
@ -41970,7 +41813,7 @@
"@overleaf/o-error": "^3.4.0",
"@overleaf/redis-wrapper": "^2.0.0",
"@overleaf/settings": "^3.0.0",
"async": "^0.9.0",
"async": "^3.2.2",
"base64id": "0.1.0",
"body-parser": "^1.19.0",
"bunyan": "^1.8.15",
@ -41993,11 +41836,6 @@
"underscore": "1.13.1"
},
"dependencies": {
"async": {
"version": "0.9.2",
"resolved": "https://registry.npmjs.org/async/-/async-0.9.2.tgz",
"integrity": "sha1-rqdNXmHB+JlhO/ZL2mbUx48v0X0="
},
"sandboxed-module": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/sandboxed-module/-/sandboxed-module-0.3.0.tgz",
@ -42032,19 +41870,12 @@
"requires": {
"@overleaf/logger": "*",
"@overleaf/o-error": "^3.4.0",
"async": "0.6.2",
"async": "3.2.2",
"chai": "^4.3.6",
"ioredis": "~4.27.1",
"mocha": "^8.4.0",
"sandboxed-module": "^2.0.4",
"sinon": "^9.2.4"
},
"dependencies": {
"async": {
"version": "0.6.2",
"resolved": "https://registry.npmjs.org/async/-/async-0.6.2.tgz",
"integrity": "sha512-fWbn+CMBgn1KOL/UvYdsmH+gMN/fW+lzAoadt4VUFvB/t0pB4aY9RfRCCvhoA58jocHyYm5TGbeuZsPc9i1Cpg=="
}
}
},
"@overleaf/references": {
@ -42055,7 +41886,7 @@
"@overleaf/o-error": "^3.4.0",
"@overleaf/redis-wrapper": "^2.0.0",
"@overleaf/settings": "^3.0.0",
"async": "^2.1.2",
"async": "^3.2.2",
"body-parser": "^1.19.0",
"bson": "^1.1.5",
"bunyan": "^1.8.15",
@ -42072,14 +41903,6 @@
"uuid": "^7.0.3"
},
"dependencies": {
"async": {
"version": "2.6.3",
"resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz",
"integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==",
"requires": {
"lodash": "^4.17.14"
}
},
"uuid": {
"version": "7.0.3",
"resolved": "https://registry.npmjs.org/uuid/-/uuid-7.0.3.tgz",
@ -42097,7 +41920,7 @@
"@overleaf/metrics": "^4.0.0",
"@overleaf/o-error": "^3.4.0",
"@overleaf/settings": "^3.0.0",
"async": "^2.6.3",
"async": "^3.2.2",
"body-parser": "^1.19.0",
"bunyan": "^1.8.15",
"chai": "^4.3.6",
@ -42112,14 +41935,6 @@
"underscore": "1.13.1"
},
"dependencies": {
"async": {
"version": "2.6.3",
"resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz",
"integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==",
"requires": {
"lodash": "^4.17.14"
}
},
"underscore": {
"version": "1.13.1",
"resolved": "https://registry.npmjs.org/underscore/-/underscore-1.13.1.tgz",
@ -42135,7 +41950,7 @@
"@overleaf/settings": "^3.0.0",
"algolia-search": "~1.5.5",
"args-js": "0.10.12",
"async": "3.2.0",
"async": "3.2.2",
"body-parser": "^1.19.0",
"bunyan": "^1.8.15",
"chai": "^4.3.6",
@ -42344,7 +42159,7 @@
"@overleaf/o-error": "^3.4.0",
"@overleaf/redis-wrapper": "^2.0.1",
"@overleaf/settings": "^3.0.0",
"async": "^2.6.3",
"async": "^3.2.2",
"body-parser": "^1.19.0",
"bunyan": "^1.8.15",
"chai": "^4.3.6",
@ -42364,14 +42179,6 @@
"uuid": "^8.3.2"
},
"dependencies": {
"async": {
"version": "2.6.3",
"resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz",
"integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==",
"requires": {
"lodash": "^4.17.14"
}
},
"diff": {
"version": "4.0.2",
"resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz",
@ -42431,7 +42238,7 @@
"@overleaf/metrics": "^4.0.0",
"@overleaf/o-error": "^3.4.0",
"@overleaf/settings": "^3.0.0",
"async": "^2.6.3",
"async": "^3.2.2",
"body-parser": "^1.19.0",
"bunyan": "^1.8.15",
"chai": "^4.3.6",
@ -42449,14 +42256,6 @@
"sinon-chai": "^3.7.0"
},
"dependencies": {
"async": {
"version": "2.6.3",
"resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz",
"integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==",
"requires": {
"lodash": "^4.17.14"
}
},
"diff": {
"version": "4.0.2",
"resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz",
@ -42522,7 +42321,7 @@
"@overleaf/o-error": "^3.4.0",
"@overleaf/redis-wrapper": "^2.0.0",
"@overleaf/settings": "^3.0.0",
"async": "^2.6.3",
"async": "^3.2.2",
"aws-sdk": "^2.643.0",
"body-parser": "^1.19.0",
"bson": "^1.1.5",
@ -42551,14 +42350,6 @@
"yazl": "^2.5.1"
},
"dependencies": {
"async": {
"version": "2.6.3",
"resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz",
"integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==",
"requires": {
"lodash": "^4.17.14"
}
},
"body-parser": {
"version": "1.19.0",
"resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.0.tgz",
@ -42841,7 +42632,7 @@
"angular-mocks": "~1.8.0",
"angular-sanitize": "~1.8.0",
"archiver": "^5.3.0",
"async": "0.6.2",
"async": "3.2.2",
"autoprefixer": "^9.7.6",
"babel-loader": "^8.2.4",
"babel-plugin-angularjs-annotate": "^0.10.0",
@ -43085,11 +42876,6 @@
"integrity": "sha512-1OvF9IbWwaeiM9VhzYXVQacMibxpXOMYVNIvMtKRyX9SImBXpKcFr8XvFDeEslCyuH/t6KRt7HEO94AlP8Iatw==",
"dev": true
},
"async": {
"version": "0.6.2",
"resolved": "https://registry.npmjs.org/async/-/async-0.6.2.tgz",
"integrity": "sha1-Qf0DijgSwKi8GELs8IumPrA5K+8="
},
"body-parser": {
"version": "1.19.0",
"resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.0.tgz",
@ -46774,9 +46560,9 @@
"dev": true
},
"async": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/async/-/async-3.2.0.tgz",
"integrity": "sha512-TR2mEZFVOj2pLStYxLht7TyfuRzaydfpxr3k9RpHIzMgw7A64dzsdqCxH1WJyQdoe8T10nDXd9wnEigmiuHIZw=="
"version": "3.2.2",
"resolved": "https://registry.npmjs.org/async/-/async-3.2.2.tgz",
"integrity": "sha512-H0E+qZaDEfx/FY4t7iLRv1W2fFI6+pyCeTw1uN20AQPiwqwM6ojPxHxdLv4z8hi2DtnW9BOckSspLucW7pIE5g=="
},
"async-limiter": {
"version": "1.0.1",

View file

@ -19,7 +19,7 @@
"@overleaf/logger": "^3.1.0",
"@overleaf/metrics": "^4.0.0",
"@overleaf/settings": "^3.0.0",
"async": "^3.2.0",
"async": "^3.2.2",
"body-parser": "^1.19.0",
"express": "4.17.1",
"mongodb": "^3.6.0"

View file

@ -13,6 +13,6 @@ const queue = async.queue(
Settings.parallelSqlQueryLimit
)
queue.drain = () => logger.debug('all items have been processed')
queue.drain(() => logger.debug('all items have been processed'))
module.exports = { queue }

View file

@ -20,7 +20,7 @@
"@overleaf/metrics": "^4.0.0",
"@overleaf/o-error": "^3.4.0",
"@overleaf/settings": "^3.0.0",
"async": "3.2.0",
"async": "3.2.2",
"body-parser": "^1.19.0",
"bunyan": "^1.8.15",
"diskusage": "^1.1.3",

View file

@ -19,7 +19,7 @@
"@overleaf/logger": "^3.1.0",
"@overleaf/metrics": "^4.0.0",
"@overleaf/settings": "^3.0.0",
"async": "^2.6.3",
"async": "^3.2.2",
"body-parser": "^1.19.0",
"bunyan": "^1.8.15",
"express": "^4.17.1",

View file

@ -21,7 +21,7 @@
"@overleaf/o-error": "^3.4.0",
"@overleaf/object-persistor": "^1.0.1",
"@overleaf/settings": "^3.0.0",
"async": "^2.6.3",
"async": "^3.2.2",
"body-parser": "^1.19.0",
"bunyan": "^1.8.15",
"celebrate": "^13.0.4",

View file

@ -21,7 +21,7 @@
"@overleaf/o-error": "^3.4.0",
"@overleaf/redis-wrapper": "^2.0.1",
"@overleaf/settings": "^3.0.0",
"async": "^2.5.0",
"async": "^3.2.2",
"body-parser": "^1.19.0",
"bunyan": "^1.8.15",
"diff-match-patch": "https://github.com/overleaf/diff-match-patch/archive/89805f9c671a77a263fc53461acd62aa7498f688.tar.gz",

View file

@ -21,7 +21,7 @@
"@overleaf/logger": "^3.1.0",
"@overleaf/metrics": "^4.0.0",
"@overleaf/settings": "^3.0.0",
"async": "^2.6.3",
"async": "^3.2.2",
"body-parser": "^1.19.0",
"bunyan": "^1.8.15",
"express": "4.17.1",

View file

@ -22,7 +22,7 @@
"@overleaf/o-error": "^3.4.0",
"@overleaf/redis-wrapper": "^2.0.0",
"@overleaf/settings": "^3.0.0",
"async": "^0.9.0",
"async": "^3.2.2",
"base64id": "0.1.0",
"body-parser": "^1.19.0",
"bunyan": "^1.8.15",

View file

@ -26,7 +26,7 @@
"@overleaf/metrics": "^4.0.0",
"@overleaf/o-error": "^3.4.0",
"@overleaf/settings": "^3.0.0",
"async": "^2.6.3",
"async": "^3.2.2",
"body-parser": "^1.19.0",
"bunyan": "^1.8.15",
"express": "^4.17.1",

View file

@ -149,7 +149,7 @@ const q = async.queue(
3
)
q.drain = () => console.log('all items have been processed')
q.drain(() => console.log('all items have been processed'))
for (let i = 0; i <= 1000; i++) {
q.push({

View file

@ -591,11 +591,13 @@ module.exports = UpdatesManager = {
}
// repeatedly get updates and pass them through the summariser to get an final output with user info
return async.whilst(
() =>
cb =>
// console.log "checking iterator.done", iterator.done()
cb(
null,
summarizedUpdates.length < options.min_count &&
!iterator.done(),
!iterator.done()
),
cb =>
iterator.next(function (err, partialUpdates) {
if (err != null) {
@ -651,7 +653,7 @@ module.exports = UpdatesManager = {
const accumulatedUserIds = new Set()
async.whilst(
() => !iterator.done(),
cb => cb(null, !iterator.done()),
cb =>
iterator.next((err, updatesFromASinglePack) => {

View file

@ -21,7 +21,7 @@
"@overleaf/o-error": "^3.4.0",
"@overleaf/redis-wrapper": "^2.0.0",
"@overleaf/settings": "^3.0.0",
"async": "^2.6.3",
"async": "^3.2.2",
"aws-sdk": "^2.643.0",
"body-parser": "^1.19.0",
"bson": "^1.1.5",

View file

@ -72,7 +72,7 @@ module.exports = ExportsHandler = {
// TODO: when we update async, signature will change from (cb, results) to (results, cb)
rootDoc: [
'project',
(cb, results) =>
(results, cb) =>
ProjectRootDocManager.ensureRootDocumentIsValid(
project_id,
function (error) {

View file

@ -785,7 +785,7 @@ const ProjectController = {
},
brandVariation: [
'project',
(cb, results) => {
(results, cb) => {
if (
(results.project != null
? results.project.brandVariationId

View file

@ -95,7 +95,7 @@ module.exports = ProjectRootDocManager = {
let doc = null
return async.until(
() => doc != null || files.length === 0,
cb => cb(null, doc != null || files.length === 0),
function (cb) {
const file = files.shift()
return fs.readFile(

View file

@ -64,7 +64,7 @@ function buildUsersSubscriptionViewModel(user, callback) {
},
recurlySubscription: [
'personalSubscription',
(cb, { personalSubscription }) => {
({ personalSubscription }, cb) => {
if (
personalSubscription == null ||
personalSubscription.recurlySubscription_id == null ||
@ -81,7 +81,7 @@ function buildUsersSubscriptionViewModel(user, callback) {
],
recurlyCoupons: [
'recurlySubscription',
(cb, { recurlySubscription }) => {
({ recurlySubscription }, cb) => {
if (!recurlySubscription) {
return cb(null, null)
}
@ -91,7 +91,7 @@ function buildUsersSubscriptionViewModel(user, callback) {
],
plan: [
'personalSubscription',
(cb, { personalSubscription }) => {
({ personalSubscription }, cb) => {
if (personalSubscription == null) {
return cb()
}

View file

@ -82,7 +82,7 @@
"angular": "~1.8.0",
"angular-sanitize": "~1.8.0",
"archiver": "^5.3.0",
"async": "0.6.2",
"async": "3.2.2",
"backbone": "^1.3.3",
"basic-auth": "^2.0.1",
"bcrypt": "^5.0.0",

View file

@ -43,12 +43,12 @@ function scanAndPurge(cb) {
})
stream.on('end', () => {
queue.drain = () => {
queue.drain(() => {
console.log(
`All sessions have been checked, ${totalDeletedSessions} deleted`
)
cb()
}
})
})
stream.on('error', err => {

View file

@ -89,7 +89,7 @@ describe('UserSessionsManager', function () {
it('should not produce an error', function (done) {
return this.call(err => {
expect(err).to.not.be.instanceof(Error)
expect(err).to.not.exist
return done()
})
})
@ -144,8 +144,7 @@ describe('UserSessionsManager', function () {
it('should not produce an error', function (done) {
return this.call(err => {
expect(err).to.not.be.instanceof(Error)
expect(err).to.equal(null)
expect(err).to.not.exist
return done()
})
})
@ -181,8 +180,7 @@ describe('UserSessionsManager', function () {
it('should not produce an error', function (done) {
return this.call(err => {
expect(err).to.not.be.instanceof(Error)
expect(err).to.equal(null)
expect(err).to.not.exist
return done()
})
})
@ -227,8 +225,7 @@ describe('UserSessionsManager', function () {
it('should not produce an error', function (done) {
return this.call(err => {
expect(err).to.not.be.instanceof(Error)
expect(err).to.equal(undefined)
expect(err).to.not.exist
return done()
})
})
@ -283,8 +280,7 @@ describe('UserSessionsManager', function () {
it('should not produce an error', function (done) {
return this.call(err => {
expect(err).to.not.be.instanceof(Error)
expect(err).to.equal(null)
expect(err).to.not.exist
return done()
})
})
@ -320,8 +316,7 @@ describe('UserSessionsManager', function () {
it('should not produce an error', function (done) {
return this.call(err => {
expect(err).to.not.be.instanceof(Error)
expect(err).to.equal(null)
expect(err).to.not.exist
return done()
})
})
@ -363,8 +358,7 @@ describe('UserSessionsManager', function () {
it('should not produce an error', function (done) {
return this.call(err => {
expect(err).to.not.be.instanceof(Error)
expect(err).to.equal(null)
expect(err).to.not.exist
return done()
})
})
@ -407,8 +401,7 @@ describe('UserSessionsManager', function () {
it('should not produce an error', function (done) {
return this.call(err => {
expect(err).to.not.be.instanceof(Error)
expect(err).to.equal(null)
expect(err).to.not.exist
return done()
})
})
@ -474,8 +467,7 @@ describe('UserSessionsManager', function () {
it('should not produce an error', function (done) {
return this.call(err => {
expect(err).to.not.be.instanceof(Error)
expect(err).to.equal(null)
expect(err).to.not.exist
return done()
})
})
@ -497,8 +489,7 @@ describe('UserSessionsManager', function () {
it('should not produce an error', function (done) {
return this.call(err => {
expect(err).to.not.be.instanceof(Error)
expect(err).to.equal(null)
expect(err).to.not.exist
return done()
})
})
@ -524,8 +515,7 @@ describe('UserSessionsManager', function () {
it('should not produce an error', function (done) {
return this.call(err => {
expect(err).to.not.be.instanceof(Error)
expect(err).to.equal(null)
expect(err).to.not.exist
return done()
})
})
@ -559,8 +549,7 @@ describe('UserSessionsManager', function () {
it('should not produce an error', function (done) {
return this.call(err => {
expect(err).to.not.be.instanceof(Error)
expect(err).to.equal(null)
expect(err).to.not.exist
return done()
})
})
@ -598,7 +587,7 @@ describe('UserSessionsManager', function () {
it('should not produce an error', function (done) {
return this.call((err, sessions) => {
expect(err).to.equal(null)
expect(err).to.not.exist
return done()
})
})
@ -635,7 +624,7 @@ describe('UserSessionsManager', function () {
it('should not produce an error', function (done) {
return this.call((err, sessions) => {
expect(err).to.equal(null)
expect(err).to.not.exist
return done()
})
})
@ -713,8 +702,7 @@ describe('UserSessionsManager', function () {
it('should not produce an error', function (done) {
return this.call(err => {
expect(err).to.not.be.instanceof(Error)
expect(err).to.equal(undefined)
expect(err).to.not.exist
return done()
})
})
@ -736,8 +724,7 @@ describe('UserSessionsManager', function () {
it('should not produce an error', function (done) {
return this.call(err => {
expect(err).to.not.be.instanceof(Error)
expect(err).to.equal(undefined)
expect(err).to.not.exist
return done()
})
})
@ -762,8 +749,7 @@ describe('UserSessionsManager', function () {
it('should not produce an error', function (done) {
return this.call(err => {
expect(err).to.not.be.instanceof(Error)
expect(err).to.equal(null)
expect(err).to.not.exist
return done()
})
})

View file

@ -74,6 +74,10 @@ describe('LockManager - getting the lock', function () {
it('should return the callback', function () {
return this.callback.calledWith(null).should.equal(true)
})
it('should clear the lock queue', function () {
this.LockManager._lockQueuesSize().should.equal(0)
})
})
describe('when the lock is initially set', function () {
@ -107,6 +111,10 @@ describe('LockManager - getting the lock', function () {
it('should return the callback', function () {
return this.callback.calledWith(null).should.equal(true)
})
it('should clear the lock queue', function () {
this.LockManager._lockQueuesSize().should.equal(0)
})
})
describe('when the lock times out', function () {
@ -178,5 +186,9 @@ describe('LockManager - getting the lock', function () {
it('should process the requests in order', function () {
return this.results.should.deep.equal([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])
})
it('should clear the lock queue', function () {
this.LockManager._lockQueuesSize().should.equal(0)
})
})
})