cassproject 1.5.49 → 1.5.51
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -49,6 +49,12 @@ Development unit tests presume you have a CaSS Repository running on `localhost:
|
|
|
49
49
|
|
|
50
50
|
# Changelog
|
|
51
51
|
|
|
52
|
+
## 1.5.51
|
|
53
|
+
* Fixed bug in node causing EPIPE and ENOTFOUND under heavy load.
|
|
54
|
+
|
|
55
|
+
## 1.5.49
|
|
56
|
+
* Fixed bug in precache.
|
|
57
|
+
|
|
52
58
|
## 1.5.48
|
|
53
59
|
* EcRepository.precache now returns all urls it can, regardless of whether they were fetched from the server.
|
|
54
60
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cassproject",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.51",
|
|
4
4
|
"description": "Competency and Skills Service",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -9,12 +9,12 @@
|
|
|
9
9
|
"multitest": "concurrently --kill-others --kill-others-on-fail \"npm run test15\" \"npm run test14\" \"npm run test13\" \"npm run test12\"",
|
|
10
10
|
"testCassTest": "npm run testkill && docker run -d --name cass-test -p80:80 -e CASS_LOOPBACK cass-test && wait-on http://localhost/api/ping && npm run testNode18 && npm run testNode18Fips && npm run testNode16 && npm run testNode15 && npm run testNode14 && npm run testNode13 && npm run testNode12 && npm run testCypressEdge && npm run testCypress && npm run testkill",
|
|
11
11
|
"testDevHttps": "npm run testkill && docker run -d --name cass-test -p443:80 -e CASS_LOOPBACK -e HTTPS=true cassproject/cass:dev && wait-on https://localhost/api/ping && npm run testNode18HttpsFips && npm run testNode18Https && npm run testNode16Https && npm run testNode15Https && npm run testNode14Https && npm run testNode13Https && npm run testNode12Https && npm run testCypressEdgeHttps && npm run testCypressHttps",
|
|
12
|
-
"test15HttpsFips": "npm run testkill && docker run -d --name cass-test -p443:443 -e CASS_LOOPBACK -e HTTPS=true cassproject/cass:1.5.
|
|
13
|
-
"test15Https11Fips": "npm run testkill && docker run -d --name cass-test -p443:443 -e CASS_LOOPBACK -e HTTPS=true -e HTTP2=false cassproject/cass:1.5.
|
|
14
|
-
"test15Https": "npm run testkill && docker run -d --name cass-test -p443:443 -e CASS_LOOPBACK -e HTTPS=true cassproject/cass:1.5.
|
|
15
|
-
"test15Https11": "npm run testkill && docker run -d --name cass-test -p443:443 -e CASS_LOOPBACK -e HTTPS=true -e HTTP2=false cassproject/cass:1.5.
|
|
16
|
-
"test15Fips": "export CASS_LOOPBACK=http://localhost/api/|| set CASS_LOOPBACK=http://localhost/api/&& npm run testkill15 && docker run -d -e CASS_LOOPBACK --name cass-test15 -p80:80 cassproject/cass:1.5.
|
|
17
|
-
"test15": "export CASS_LOOPBACK=http://localhost/api/|| set CASS_LOOPBACK=http://localhost/api/&& npm run testkill15 && docker run -d -e CASS_LOOPBACK --name cass-test15 -p80:80 cassproject/cass:1.5.
|
|
12
|
+
"test15HttpsFips": "npm run testkill && docker run -d --name cass-test -p443:443 -e CASS_LOOPBACK -e HTTPS=true cassproject/cass:1.5.50 && wait-on https://localhost/api/ping && concurrently --kill-others-on-fail \"npm run testCypressHttps\" \"npm run testNode20Https\" \"npm run testNode20HttpsFips\" \"npm run testNode20HttpsForceFips\" \"npm run testNode18Https\" \"npm run testNode18HttpsFips\" \"npm run testNode16Https\" && npm run testkill",
|
|
13
|
+
"test15Https11Fips": "npm run testkill && docker run -d --name cass-test -p443:443 -e CASS_LOOPBACK -e HTTPS=true -e HTTP2=false cassproject/cass:1.5.50 && wait-on https://localhost/api/ping && concurrently --kill-others-on-fail \"npm run testCypressHttps\" \"npm run testNode20Https\" \"npm run testNode20HttpsFips\" \"npm run testNode20HttpsForceFips\" \"npm run testNode18Https\" \"npm run testNode18HttpsFips\" \"npm run testNode16Https\" && npm run testkill",
|
|
14
|
+
"test15Https": "npm run testkill && docker run -d --name cass-test -p443:443 -e CASS_LOOPBACK -e HTTPS=true cassproject/cass:1.5.50 && wait-on https://localhost/api/ping && concurrently --kill-others-on-fail \"npm run testCypressHttps\" \"npm run testNode20Https\" \"npm run testNode20HttpsFips\" \"npm run testNode18Https\" \"npm run testNode18HttpsFips\" \"npm run testNode16Https\" && npm run testkill",
|
|
15
|
+
"test15Https11": "npm run testkill && docker run -d --name cass-test -p443:443 -e CASS_LOOPBACK -e HTTPS=true -e HTTP2=false cassproject/cass:1.5.50 && wait-on https://localhost/api/ping && concurrently --kill-others-on-fail \"npm run testCypressHttps\" \"npm run testNode20Https\" \"npm run testNode20HttpsFips\" \"npm run testNode18Https\" \"npm run testNode18HttpsFips\" \"npm run testNode16Https\" && npm run testkill",
|
|
16
|
+
"test15Fips": "export CASS_LOOPBACK=http://localhost/api/|| set CASS_LOOPBACK=http://localhost/api/&& npm run testkill15 && docker run -d -e CASS_LOOPBACK --name cass-test15 -p80:80 cassproject/cass:1.5.50 && wait-on http://localhost/api/ping && concurrently --kill-others-on-fail \"npm run testCypress\" \"npm run testNode20\" \"npm run testNode20Fips\" \"npm run testNode20ForceFips\" \"npm run testNode18\" \"npm run testNode18Fips\" \"npm run testNode16\" && npm run testkill15",
|
|
17
|
+
"test15": "export CASS_LOOPBACK=http://localhost/api/|| set CASS_LOOPBACK=http://localhost/api/&& npm run testkill15 && docker run -d -e CASS_LOOPBACK --name cass-test15 -p80:80 cassproject/cass:1.5.50 && wait-on http://localhost/api/ping && concurrently --kill-others-on-fail \"npm run testCypress\" \"npm run testNode20\" \"npm run testNode20Fips\" \"npm run testNode18\" \"npm run testNode18Fips\" \"npm run testNode16\" && npm run testkill15",
|
|
18
18
|
"test14": "npm run testkill14 && docker run -d -e CASS_LOOPBACK --name cass-test14 -p80:80 cassproject/cass:1.4.4 && wait-on http://localhost/api/ping && concurrently --kill-others-on-fail \"npm run testCypress\" \"npm run testNode16\" && npm run testkill14",
|
|
19
19
|
"test13": "npm run testkill13 && docker run -d -e CASS_LOOPBACK --name cass-test13 -p80:80 cassproject/cass:1.3.18 && wait-on http://localhost/api/ping && concurrently --kill-others-on-fail \"npm run testCypress\" \"npm run testNode16\" && npm run testkill13",
|
|
20
20
|
"test12": "npm run testkill12 && docker run -d -e CASS_LOOPBACK --name cass-test12 -p80:80 cassproject/cass:1.2.44 && wait-on http://localhost/api/ping && concurrently --kill-others-on-fail \"npm run testCypress\" \"npm run testNode16\" && npm run testkill12",
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
"webpack:cypressHttps": "cypress run -e CASS_LOOPBACK=https://localhost/api/ --config-file cypressWebpack.config.js --headless --browser chrome",
|
|
79
79
|
"webpack:cypressEdge": "cypress run --config-file cypressWebpack.config.js --headless --browser edge",
|
|
80
80
|
"webpack:cypressEdgeHttps": "cypress run -e CASS_LOOPBACK=https://localhost/api/ --config-file cypressWebpack.config.js --browser edge",
|
|
81
|
-
"webpack:cypressFirefoxHttps": "cypress
|
|
81
|
+
"webpack:cypressFirefoxHttps": "cypress run -e CASS_LOOPBACK=https://localhost/api/ --config-file cypressWebpack.config.js --browser firefox"
|
|
82
82
|
},
|
|
83
83
|
"contributors": [
|
|
84
84
|
{
|
|
@@ -151,7 +151,7 @@
|
|
|
151
151
|
"convert-hrtime": "^5.0.0",
|
|
152
152
|
"cypress": "^13.7.1",
|
|
153
153
|
"eslint": "^8.57.0",
|
|
154
|
-
"mocha": "^10.
|
|
154
|
+
"mocha": "^10.4.0",
|
|
155
155
|
"node-polyfill-webpack-plugin": "^2.0.1",
|
|
156
156
|
"nodemon": "^3.1.0",
|
|
157
157
|
"nyc": "^15.1.0",
|
|
@@ -50,6 +50,12 @@ const { cassPromisify } = require("../promises/helpers");
|
|
|
50
50
|
* @module com.eduworks.ec
|
|
51
51
|
*/
|
|
52
52
|
module.exports = class EcRemote {
|
|
53
|
+
//See https://github.com/nodejs/node/issues/47130 -- This is a workaround for a bug that causes http 1.1 keep-alive from throwing an error.
|
|
54
|
+
static leTired() {
|
|
55
|
+
if (isNode)
|
|
56
|
+
return new Promise(resolve => setTimeout(resolve, 1));
|
|
57
|
+
return new Promise(resolve => resolve());
|
|
58
|
+
}
|
|
53
59
|
static set async(value) {
|
|
54
60
|
console.trace(
|
|
55
61
|
"DISCONTINUED: Instead of setting EcRemote.async, please use await."
|
|
@@ -156,11 +162,12 @@ module.exports = class EcRemote {
|
|
|
156
162
|
}
|
|
157
163
|
url = EcRemote.upgradeHttpToHttps(url);
|
|
158
164
|
|
|
159
|
-
let p =
|
|
165
|
+
let p = EcRemote.leTired().then(()=>
|
|
166
|
+
fetch(url, {
|
|
160
167
|
method: 'POST',
|
|
161
168
|
body: fd,
|
|
162
169
|
headers: headers || {},
|
|
163
|
-
}).then(async (response) => {
|
|
170
|
+
})).then(async (response) => {
|
|
164
171
|
|
|
165
172
|
const contentType = response.headers.get("content-type");
|
|
166
173
|
let result = null;
|
|
@@ -235,7 +242,7 @@ module.exports = class EcRemote {
|
|
|
235
242
|
console.log("GET " + server + "" + (service || ""));
|
|
236
243
|
let url = EcRemote.urlAppend(server, service);
|
|
237
244
|
url = EcRemote.upgradeHttpToHttps(url);
|
|
238
|
-
let p = fetch(url).then(async (response) => {
|
|
245
|
+
let p = EcRemote.leTired().then(() => fetch(url)).then(async (response) => {
|
|
239
246
|
|
|
240
247
|
const contentType = response.headers.get("content-type");
|
|
241
248
|
let result = null;
|
|
@@ -315,10 +322,10 @@ module.exports = class EcRemote {
|
|
|
315
322
|
console.log("DELETE " + url);
|
|
316
323
|
url = EcRemote.upgradeHttpToHttps(url);
|
|
317
324
|
|
|
318
|
-
let p = fetch(url, {
|
|
325
|
+
let p = EcRemote.leTired().then(() => fetch(url, {
|
|
319
326
|
method: 'DELETE',
|
|
320
327
|
headers: { signatureSheet: signatureSheet }
|
|
321
|
-
}).then(async (response) => {
|
|
328
|
+
})).then(async (response) => {
|
|
322
329
|
if (!response.ok) {
|
|
323
330
|
throw new Error(response.statusText);
|
|
324
331
|
}
|
|
@@ -978,12 +978,12 @@ module.exports = class EcRepository {
|
|
|
978
978
|
* @method precache
|
|
979
979
|
*/
|
|
980
980
|
precache = function (urls, success, failure, eim) {
|
|
981
|
-
let originals = [...urls];
|
|
982
981
|
if (eim === undefined || eim == null)
|
|
983
982
|
eim = EcIdentityManager.default;
|
|
984
983
|
if (urls == null) {
|
|
985
984
|
throw new Error("urls not defined.");
|
|
986
985
|
}
|
|
986
|
+
let originals = [...urls];
|
|
987
987
|
if (EcRepository.caching == true)
|
|
988
988
|
urls = urls.filter(url => EcRepository.cache[url] === undefined);
|
|
989
989
|
urls = urls.map(
|
|
@@ -996,7 +996,7 @@ module.exports = class EcRepository {
|
|
|
996
996
|
if (EcRepository.caching == true)
|
|
997
997
|
urls = urls.filter(url => EcRepository.cache[url] === undefined);
|
|
998
998
|
if (urls.length == 0) {
|
|
999
|
-
return new Promise((resolve, reject) => resolve());
|
|
999
|
+
return new Promise((resolve, reject) => resolve()).then(()=>originals.map(url=>EcRepository.cache[url]).filter(x=>x));
|
|
1000
1000
|
}
|
|
1001
1001
|
let fd = new FormData();
|
|
1002
1002
|
fd.append("data", JSON.stringify(urls));
|