Merge pull request #2870 from jryans/degraded-storage

Track store failures after startup
pull/21833/head
J. Ryan Stinnett 2019-04-05 18:08:21 +01:00 committed by GitHub
commit 67d22ab331
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 0 deletions

View File

@ -31,6 +31,7 @@ import {phasedRollOutExpiredForUser} from "./PhasedRollOut";
import Modal from './Modal';
import {verificationMethods} from 'matrix-js-sdk/lib/crypto';
import MatrixClientBackedSettingsHandler from "./settings/handlers/MatrixClientBackedSettingsHandler";
import * as StorageManager from './utils/StorageManager';
interface MatrixClientCreds {
homeserverUrl: string,
@ -113,6 +114,8 @@ class MatrixClientPeg {
}
}
StorageManager.trackStores(this.matrixClient);
// try to initialise e2e on the new client
try {
// check that we have a version of the js-sdk which includes initCrypto

View File

@ -147,3 +147,11 @@ async function checkCryptoStore() {
log("Crypto store using memory only");
return { exists, healthy: false };
}
export function trackStores(client) {
if (client.store && client.store.on) {
client.store.on("degraded", () => {
track("Sync store using IndexedDB degraded to memory");
});
}
}