1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-07-28 15:22:05 +03:00

Add basic storage consistency check

This adds a storage consistency check just before creating a client on login.
Each data store we use is checked for data and any problems are logged to the
console.

Fixes https://github.com/vector-im/riot-web/issues/9271
This commit is contained in:
J. Ryan Stinnett
2019-03-25 17:43:53 +00:00
parent 90dbeefcfb
commit 4c0f459995
2 changed files with 94 additions and 1 deletions

View File

@ -31,7 +31,8 @@ import Modal from './Modal';
import sdk from './index';
import ActiveWidgetStore from './stores/ActiveWidgetStore';
import PlatformPeg from "./PlatformPeg";
import {sendLoginRequest} from "./Login";
import { sendLoginRequest } from "./Login";
import * as StorageManager from './utils/StorageManager';
/**
* Called at startup, to attempt to build a logged-in Matrix session. It tries
@ -353,6 +354,8 @@ async function _doSetLoggedIn(credentials, clearStorage) {
await _clearStorage();
}
await StorageManager.checkConsistency();
Analytics.setLoggedIn(credentials.guest, credentials.homeserverUrl, credentials.identityServerUrl);
if (localStorage) {