From 038f5767f2321f1b414f6b1bd26b455440bc01ee Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Thu, 23 Feb 2017 14:37:46 +0000 Subject: [PATCH] Add a comment --- src/vector/rageshake.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/vector/rageshake.js b/src/vector/rageshake.js index 5712f24f..09acca44 100644 --- a/src/vector/rageshake.js +++ b/src/vector/rageshake.js @@ -314,6 +314,9 @@ class IndexedDBLogStore { let size = 0; for (let i = 0; i < allLogIds.length; i++) { let lines = await fetchLogs(allLogIds[i]); + + // always include at least one log file, but only include + // subsequent ones if they won't take us over the MAX_LOG_SIZE if (i > 0 && size + lines.length > MAX_LOG_SIZE) { // the remaining log IDs should be removed. If we go out of // bounds this is just [] @@ -323,6 +326,7 @@ class IndexedDBLogStore { removeLogIds = allLogIds.slice(i + 1); break; } + logs.push({ lines: lines, id: allLogIds[i],