Commit 45be1eaf authored by Romain Courteaud's avatar Romain Courteaud

Release 3.44.0

parent 2411a6e0
Pipeline #17426 failed with stage
in 0 seconds
......@@ -26,7 +26,7 @@ TESTDIR = test
EXAMPLEDIR = examples
EXTERNALDIR = external
VERSION = 3.43.0
VERSION = 3.44.0
JIOVERSION = ${DISTDIR}/jio-v${VERSION}.js
JIOLATEST = ${DISTDIR}/jio-latest.js
JIONODEVERSION = ${DISTDIR}/jio-v${VERSION}-node.js
......
......@@ -10154,8 +10154,11 @@ var Blob = window.Blob,
"use strict";
/* Safari does not define DOMError */
/* + compat issue with private Firefox */
if (window.DOMError === undefined) {
window.DOMError = {};
window.DOMError = function FakeDOMError(message) {
this.message = message;
};
}
var util = {},
......@@ -12647,6 +12650,100 @@ var jIO = window.jIO,
jIO.addStorage('replicate', ReplicateStorage);
}(jIO, RSVP, Rusha, jIO.util.stringify));
/*
* JIO extension for resource replication.
* Copyright (C) 2021 Nexedi SA
*
* This program is free software: you can Use, Study, Modify and Redistribute
* it under the terms of the GNU General Public License version 3, or (at your
* option) any later version, as published by the Free Software Foundation.
*
* You can also Link and Combine this program with other software covered by
* the terms of any of the Free Software licenses or any of the Open Source
* Initiative approved licenses and Convey the resulting work. Corresponding
* source of such a combination shall include the source code for all other
* software used.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* See COPYING file for full licensing terms.
* See https://www.nexedi.com/licensing for rationale and options.
*/
/*jslint nomen: true*/
/*global jIO*/
(function (jIO) {
"use strict";
function FallbackStorage(spec) {
this._sub_storage = this._current_storage = jIO.createJIO(spec.sub_storage);
if (spec.hasOwnProperty('fallback_storage')) {
this._fallback_storage = jIO.createJIO(spec.fallback_storage);
this._checked = false;
} else {
this._checked = true;
}
}
var method_name_list = [
'get',
'put',
'post',
'remove',
'buildQuery',
'getAttachment',
'putAttachment',
'allAttachments',
'repair'
],
i;
function methodFallback(method_name) {
return function () {
var storage = this,
queue = storage._current_storage[method_name].apply(
storage._current_storage,
arguments
),
argument_list = arguments;
if (!storage._checked) {
queue
.push(function (result) {
storage._checked = true;
return result;
}, function (error) {
storage._checked = true;
if ((error instanceof jIO.util.jIOError) &&
(error.status_code === 500)) {
// If storage is not working, use fallback instead
storage._current_storage = storage._fallback_storage;
return storage._current_storage[method_name].apply(
storage._current_storage,
argument_list
);
}
throw error;
});
}
return queue;
};
}
for (i = 0; i < method_name_list.length; i += 1) {
FallbackStorage.prototype[method_name_list[i]] =
methodFallback(method_name_list[i]);
}
FallbackStorage.prototype.hasCapacity = function hasCapacity(name) {
return (this._sub_storage.hasCapacity(name) &&
this._fallback_storage.hasCapacity(name));
};
jIO.addStorage('fallback', FallbackStorage);
}(jIO));
/*
* Copyright 2015, Nexedi SA
*
......@@ -15095,11 +15192,8 @@ var jIO = window.jIO,
if (atob(exec[1]) === id) {
attachments[atob(exec[2])] = {};
}
} catch (error) {
} catch (ignore) {
// Check if unable to decode base64 data
if (!error instanceof ReferenceError) {
throw error;
}
}
}
}
......@@ -15165,11 +15259,8 @@ var jIO = window.jIO,
if (DOCUMENT_REGEXP.test(key)) {
try {
id = atob(DOCUMENT_REGEXP.exec(key)[1]);
} catch (error) {
} catch (ignore) {
// Check if unable to decode base64 data
if (!error instanceof ReferenceError) {
throw error;
}
}
if (id !== undefined) {
id_dict[id] = null;
......@@ -15179,11 +15270,8 @@ var jIO = window.jIO,
try {
id = atob(exec[1]);
attachment = atob(exec[2]);
} catch (error) {
} catch (ignore) {
// Check if unable to decode base64 data
if (!error instanceof ReferenceError) {
throw error;
}
}
if (attachment !== undefined) {
if (!id_dict.hasOwnProperty(id)) {
......@@ -15234,11 +15322,8 @@ var jIO = window.jIO,
id: atob(DOCUMENT_REGEXP.exec(key)[1]),
value: {}
});
} catch (error) {
} catch (ignore) {
// Check if unable to decode base64 data
if (!error instanceof ReferenceError) {
throw error;
}
}
}
}
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
{
"name": "jio",
"version": "v3.39.0",
"version": "v3.44.0",
"license": "GPLv3+",
"author": "Nexedi SA",
"contributors": [
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment