Merge pull request #2870 from jryans/degraded-storage
Track store failures after startup
This commit is contained in:
commit
67d22ab331
2 changed files with 11 additions and 0 deletions
|
@ -31,6 +31,7 @@ import {phasedRollOutExpiredForUser} from "./PhasedRollOut";
|
||||||
import Modal from './Modal';
|
import Modal from './Modal';
|
||||||
import {verificationMethods} from 'matrix-js-sdk/lib/crypto';
|
import {verificationMethods} from 'matrix-js-sdk/lib/crypto';
|
||||||
import MatrixClientBackedSettingsHandler from "./settings/handlers/MatrixClientBackedSettingsHandler";
|
import MatrixClientBackedSettingsHandler from "./settings/handlers/MatrixClientBackedSettingsHandler";
|
||||||
|
import * as StorageManager from './utils/StorageManager';
|
||||||
|
|
||||||
interface MatrixClientCreds {
|
interface MatrixClientCreds {
|
||||||
homeserverUrl: string,
|
homeserverUrl: string,
|
||||||
|
@ -113,6 +114,8 @@ class MatrixClientPeg {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
StorageManager.trackStores(this.matrixClient);
|
||||||
|
|
||||||
// try to initialise e2e on the new client
|
// try to initialise e2e on the new client
|
||||||
try {
|
try {
|
||||||
// check that we have a version of the js-sdk which includes initCrypto
|
// check that we have a version of the js-sdk which includes initCrypto
|
||||||
|
|
|
@ -147,3 +147,11 @@ async function checkCryptoStore() {
|
||||||
log("Crypto store using memory only");
|
log("Crypto store using memory only");
|
||||||
return { exists, healthy: false };
|
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");
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue