Track store failures after startup

This watches the `IndexedDBStore` in case it degrades. If it does, we track this
in analytics so we can observe how often it happens in the field.

Should help track errors like https://github.com/vector-im/riot-web/issues/7769
This commit is contained in:
J. Ryan Stinnett 2019-04-04 11:59:53 +01:00
parent fea9b009b3
commit 16573a6381
2 changed files with 11 additions and 0 deletions

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");
});
}
}