Merge branch 'soon' into staging

pull/1/head
ansuz 4 years ago
commit 0696a339cb

@ -1631,7 +1631,7 @@ define([
Store.leavePad(null, data, function () {});
};
var conf = {
Cache: Cache, // XXX re-enable cache usage
Cache: Cache, // ICE pad cache
onCacheStart: function () {
postMessage(clientId, "PAD_CACHE");
},
@ -2686,7 +2686,7 @@ define([
readOnly: false,
validateKey: secret.keys.validateKey || undefined,
crypto: Crypto.createEncryptor(secret.keys),
Cache: Cache, // XXX re-enable cache usage
Cache: Cache, // ICE drive cache
userName: 'fs',
logLevel: 1,
ChainPad: ChainPad,

@ -32,7 +32,7 @@ define([
if (!allowed) { return void cb('NOCACHE'); }
cache.getItem(id, function (err, obj) {
if (err || !obj || !obj.c) {
return void cb(err || 'EINVAL');
return void cb(Util.serializeError(err || 'EINVAL'));
}
cb(null, obj.c);
obj.t = +new Date();
@ -50,7 +50,7 @@ define([
c: u8,
t: (+new Date()) // 't' represent the "lastAccess" of this cache (get or set)
}, function (err) {
cb(err);
cb(Util.serializeError(err));
});
});
};
@ -64,7 +64,7 @@ define([
if (!allowed) { return void cb('NOCACHE'); }
cache.getItem(id, function (err, obj) {
if (err || !obj || !Array.isArray(obj.c)) {
return void cb(err || 'EINVAL');
return void cb(Util.serializeError(err || 'EINVAL'));
}
cb(null, obj);
obj.t = +new Date();
@ -108,7 +108,7 @@ define([
c: val,
t: (+new Date()) // 't' represent the "lastAccess" of this cache (get or set)
}, function (err) {
if (err) { onError(err); }
if (err) { onError(Util.serializeError(err)); }
});
}, 50);

@ -175,7 +175,7 @@ define([
ChainPad: ChainPad,
classic: true,
network: network,
Cache: Cache, // XXX re-enable cache usage
Cache: Cache, // ICE shared-folder cache
metadata: {
validateKey: secret.keys.validateKey || undefined,
owners: owners

@ -427,7 +427,7 @@ define([
channel: secret.channel,
crypto: crypto,
ChainPad: ChainPad,
Cache: Cache, // XXX re-enable cache usage
Cache: Cache, // ICE team cache
metadata: {
validateKey: secret.keys.validateKey || undefined,
},

@ -157,7 +157,22 @@ define([
var msgEv = _Util.mkEvent();
var iframe = $('#sbox-iframe')[0].contentWindow;
var postMsg = function (data) {
iframe.postMessage(data, '*');
try {
iframe.postMessage(data, '*');
} catch (err) {
console.error(err, data);
if (data && data.error && data.error instanceof Error) {
data.error = Util.serializeError(data.error);
try {
iframe.postMessage(data, '*');
} catch (err2) {
console.error("impossible serialization");
throw err2;
}
} else {
throw err;
}
}
};
var whenReady = waitFor(function (msg) {
if (msg.source !== iframe) { return; }

Loading…
Cancel
Save