diff --git a/frontend/src/storage.js b/frontend/src/storage.js index 31a1f72d..d83e1727 100644 --- a/frontend/src/storage.js +++ b/frontend/src/storage.js @@ -29,7 +29,12 @@ class Storage { for (let i = 0; i < this.engine.length; i++) { const k = this.engine.key(i); if (isFile(k)) { - fs.push(JSON.parse(this.engine.getItem(k))); // parse or whatever else + try { + fs.push(JSON.parse(this.engine.getItem(k))); + } catch (err) { + // obviously you're not a golfer + this.engine.removeItem(k); + } } } return fs.sort((file1, file2) => { diff --git a/frontend/src/utils.js b/frontend/src/utils.js index e40276c8..1c77b407 100644 --- a/frontend/src/utils.js +++ b/frontend/src/utils.js @@ -99,12 +99,7 @@ function findMetric(href) { } function isFile(id) { - return ![ - 'referrer', - 'totalDownloads', - 'totalUploads', - 'testpilot_ga__cid' - ].includes(id); + return /^[0-9a-fA-F]{10}$/.test(id); } function sendEvent() {