diff --git a/src/DecryptionFailureTracker.js b/src/DecryptionFailureTracker.js index 337f4b08c3..069d06bbd1 100644 --- a/src/DecryptionFailureTracker.js +++ b/src/DecryptionFailureTracker.js @@ -55,13 +55,13 @@ export default class DecryptionFailureTracker { this.trackDecryptionFailure = fn; } - loadTrackedEventHashMap() { - this.trackedEventHashMap = JSON.parse(localStorage.getItem('mx-decryption-failure-event-id-hashes')) || {}; - } + // loadTrackedEventHashMap() { + // this.trackedEventHashMap = JSON.parse(localStorage.getItem('mx-decryption-failure-event-id-hashes')) || {}; + // } - saveTrackedEventHashMap() { - localStorage.setItem('mx-decryption-failure-event-id-hashes', JSON.stringify(this.trackedEventHashMap)); - } + // saveTrackedEventHashMap() { + // localStorage.setItem('mx-decryption-failure-event-id-hashes', JSON.stringify(this.trackedEventHashMap)); + // } eventDecrypted(e) { if (e.isDecryptionFailure()) { @@ -143,7 +143,9 @@ export default class DecryptionFailureTracker { this.trackedEventHashMap, ); - this.saveTrackedEventHashMap(); + // Commented out for now for expediency, we need to consider unbound nature of storing + // this in localStorage + // this.saveTrackedEventHashMap(); const dedupedFailures = dedupedFailuresMap.values(); diff --git a/src/components/structures/MatrixChat.js b/src/components/structures/MatrixChat.js index 818d058271..8b36658de4 100644 --- a/src/components/structures/MatrixChat.js +++ b/src/components/structures/MatrixChat.js @@ -1313,7 +1313,10 @@ export default React.createClass({ // TODO: Pass reason for failure as third argument to trackEvent Analytics.trackEvent('E2E', 'Decryption failure'); }); - dft.loadTrackedEventHashMap(); + + // Shelved for later date when we have time to think about persisting history of + // tracked events across sessions. + // dft.loadTrackedEventHashMap(); const stopDft = dft.start(); diff --git a/test/DecryptionFailureTracker-test.js b/test/DecryptionFailureTracker-test.js index dc77b4f1d8..c4f3116cba 100644 --- a/test/DecryptionFailureTracker-test.js +++ b/test/DecryptionFailureTracker-test.js @@ -151,7 +151,7 @@ describe('DecryptionFailureTracker', function() { done(); }); - it('should not track a failure for an event that was tracked in a previous session', (done) => { + xit('should not track a failure for an event that was tracked in a previous session', (done) => { // This test uses localStorage, clear it beforehand localStorage.clear(); @@ -171,7 +171,9 @@ describe('DecryptionFailureTracker', function() { // Simulate the browser refreshing by destroying tracker and creating a new tracker const secondTracker = new DecryptionFailureTracker((failure) => failures.push(failure)); - secondTracker.loadTrackedEventHashMap(); + + //secondTracker.loadTrackedEventHashMap(); + secondTracker.eventDecrypted(decryptedEvent); secondTracker.checkFailures(Infinity); secondTracker.trackFailure();