diff --git a/lib/rpc.js b/lib/rpc.js index 11a9bb06f..f4d57b800 100644 --- a/lib/rpc.js +++ b/lib/rpc.js @@ -46,7 +46,7 @@ const AUTHENTICATED_CALLS = [ 'OWNED_UPLOAD_COMPLETE', 'UPLOAD_CANCEL', 'EXPIRE_SESSION', - 'TRIM_OWNED_CHANNEL_HISTORY', + 'TRIM_HISTORY', 'CLEAR_OWNED_CHANNEL', 'REMOVE_OWNED_CHANNEL', 'REMOVE_PINS', diff --git a/www/common/outer/history.js b/www/common/outer/history.js index 1860e38c8..bae186174 100644 --- a/www/common/outer/history.js +++ b/www/common/outer/history.js @@ -105,6 +105,8 @@ define([ return void cb({error: 'EINVAL'}); } + if (!obj.length) { return; } + hash = obj[0].hash; var messages = obj.map(function(data) { return data.msg; @@ -161,6 +163,7 @@ define([ return; } size += obj.size; + if (!obj.hash) { return; } res.push({ channel: channel, hash: obj.hash @@ -188,7 +191,9 @@ define([ nThen(function (waitFor) { channels.forEach(function (obj) { + console.warn(obj); // XXX rpc.trimHistory(obj, waitFor(function (err) { + console.error(obj.channel, arguments); // XXX if (err) { warning.push(err); return;