Skip to content

Commit 335cc32

Browse files
authored
A dep update with migration bug fixes (#1661)
* *async*@3.x migration * Using a more applicable statusCodePage for DB S3 connection issue... the error message is still rather vague since it's abstracted several times between function calls but was tested and landed on 404 during *fakeS3* usage. At some point when all callback signatures can be set to `aErr`, `aResults` this should be more explicit... until then preserving existing vagueness. * Revert #1599 as Fx still uses this in 68.x. TLSv1 EOL will still prevent Opera Presto from even visiting the site. NOTES: * Apparently version 3.x migration is extremely picky now about how Err is generated. i.e. it doesn't allow `true`/`false` anymore like it did in version 2.x. This causes the request to never complete with `async.parallel`. The web spinner and no source is retrieved even though **it was successfully retrieved**. * Been probing/testing dev manually and it seems to be non-sluggish atm with Fx 68.x... perhaps a change from 3.0 to 3.1 of this dep... or even Chromium report since distro version is/was a bit buggy at the time of testing. Post #1607 #1520 Auto-merge
1 parent a07bb4b commit 335cc32

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

controllers/user.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1679,7 +1679,9 @@ exports.uploadScript = function (aReq, aRes, aNext) {
16791679
}
16801680

16811681
// Reject non-js file
1682+
console.log(script.type);
16821683
switch (script.type) {
1684+
case 'application/x-javascript': // #872 #1661
16831685
case 'application/javascript': // #1599
16841686
case 'text/javascript': // Default
16851687
break; // Acceptable
@@ -2020,7 +2022,10 @@ exports.editScript = function (aReq, aRes, aNext) {
20202022

20212023
function asyncComplete(aErr) {
20222024
if (aErr) {
2023-
aNext();
2025+
statusCodePage(aReq, aRes, aNext, {
2026+
statusCode: (aErr instanceof statusError ? aErr.status.code : aErr.code),
2027+
statusMessage: (aErr instanceof statusError ? aErr.status.message : aErr.code)
2028+
});
20242029
return;
20252030
}
20262031

@@ -2049,7 +2054,12 @@ exports.editScript = function (aReq, aRes, aNext) {
20492054
tasks.push(function (aCallback) {
20502055
getExistingScript(aReq, options, authedUser, function (aOpts) {
20512056
options = aOpts;
2052-
aCallback(!aOpts);
2057+
2058+
aCallback(!aOpts ? new statusError({
2059+
message: 'Error while getting existing script.',
2060+
code: 500
2061+
}) : null);
2062+
20532063
});
20542064
});
20552065

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"dependencies": {
77
"ace-builds": "git://github.com/ajaxorg/ace-builds.git#7489e42",
88
"ansi-colors": "4.1.1",
9-
"async": "2.6.2",
9+
"async": "3.1.0",
1010
"aws-sdk": "2.513.0",
1111
"base62": "2.0.1",
1212
"body-parser": "1.19.0",

0 commit comments

Comments
 (0)