Merge branch 'staging' of github.com:xwiki-labs/cryptpad into cache-metadata

pull/1/head
ansuz 4 years ago
commit 66195a17a1

@ -438,13 +438,12 @@ const getHistoryOffset = (Env, channelName, lastKnownHash, _cb) => {
to reconcile their differences. */ to reconcile their differences. */
} }
// If our lastKnownHash is older than the 2nd to last checkpoint, // If our lastKnownHash is older than the 2nd to last checkpoint, send
// only send the last 2 checkpoints and ignore "lkh" // EUNKNOWN to tell the user to empty their cache
// XXX XXX this is probably wrong! ChainPad may not accept checkpoints that are not connected to root if (lkh && index.cpIndex.length >= 2 && lkh < index.cpIndex[0].offset) {
// XXX We probably need to send an EUNKNOWN here so that the client can recreate a new chainpad waitFor.abort();
/*if (lkh && index.cpIndex.length >= 2 && lkh < index.cpIndex[0].offset) { return void cb(new Error('EUNKNOWN'));
return void cb(null, index.cpIndex[0].offset); }
}*/
// Otherwise use our lastKnownHash // Otherwise use our lastKnownHash
cb(null, lkh); cb(null, lkh);

@ -2702,7 +2702,6 @@ define([
var dontShowAgain = function () { var dontShowAgain = function () {
var until = (+new Date()) + (7 * 24 * 3600 * 1000); // 7 days from now var until = (+new Date()) + (7 * 24 * 3600 * 1000); // 7 days from now
until = (+new Date()) + 30000; // XXX 30s from now
if (data.drive) { if (data.drive) {
common.setAttribute(['drive', 'trim'], until); common.setAttribute(['drive', 'trim'], until);
return; return;

@ -290,7 +290,6 @@ define([
var priv = ctx.metadataMgr.getPrivateData(); var priv = ctx.metadataMgr.getPrivateData();
var limit = 100 * 1024 * 1024; // 100MB var limit = 100 * 1024 * 1024; // 100MB
limit = 100 * 1024; // XXX 100KB
var owned; var owned;
nThen(function (w) { nThen(function (w) {

@ -955,7 +955,7 @@ define([
cb(content); cb(content);
}; };
makeBlock('trim-history', function(cb, $div) { makeBlock('trim-history', function(cb, $div) {
if (!common.isLoggedIn()) { return; } if (!common.isLoggedIn()) { return void cb(false); }
redrawTrimHistory(cb, $div); redrawTrimHistory(cb, $div);
}, true); }, true);

Loading…
Cancel
Save