You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-11-28 05:03:59 +03:00
Add a bunch of logging
to try & diagnose https://github.com/vector-im/riot-web/issues/7769
This commit is contained in:
@@ -491,6 +491,7 @@ MatrixClient.prototype.initCrypto = async function() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// initialise the list of encrypted rooms (whether or not crypto is enabled)
|
// initialise the list of encrypted rooms (whether or not crypto is enabled)
|
||||||
|
console.log("Crypto: initialising roomlist...");
|
||||||
await this._roomList.init();
|
await this._roomList.init();
|
||||||
|
|
||||||
const userId = this.getUserId();
|
const userId = this.getUserId();
|
||||||
@@ -525,6 +526,7 @@ MatrixClient.prototype.initCrypto = async function() {
|
|||||||
"crypto.warning",
|
"crypto.warning",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
console.log("Crypto: initialising crypto object...");
|
||||||
await crypto.init();
|
await crypto.init();
|
||||||
|
|
||||||
this.olmVersion = Crypto.getOlmVersion();
|
this.olmVersion = Crypto.getOlmVersion();
|
||||||
|
|||||||
@@ -197,8 +197,11 @@ utils.inherits(Crypto, EventEmitter);
|
|||||||
* Returns a promise which resolves once the crypto module is ready for use.
|
* Returns a promise which resolves once the crypto module is ready for use.
|
||||||
*/
|
*/
|
||||||
Crypto.prototype.init = async function() {
|
Crypto.prototype.init = async function() {
|
||||||
|
console.log("Crypto: initialising Olm...");
|
||||||
await global.Olm.init();
|
await global.Olm.init();
|
||||||
|
console.log("Crypto: initialising Olm device...");
|
||||||
await this._olmDevice.init();
|
await this._olmDevice.init();
|
||||||
|
console.log("Crypto: loading device list...");
|
||||||
await this._deviceList.load();
|
await this._deviceList.load();
|
||||||
|
|
||||||
// build our device keys: these will later be uploaded
|
// build our device keys: these will later be uploaded
|
||||||
@@ -207,6 +210,7 @@ Crypto.prototype.init = async function() {
|
|||||||
this._deviceKeys["curve25519:" + this._deviceId] =
|
this._deviceKeys["curve25519:" + this._deviceId] =
|
||||||
this._olmDevice.deviceCurve25519Key;
|
this._olmDevice.deviceCurve25519Key;
|
||||||
|
|
||||||
|
console.log("Crypto: fetching own devices...");
|
||||||
let myDevices = this._deviceList.getRawStoredDevicesForUser(
|
let myDevices = this._deviceList.getRawStoredDevicesForUser(
|
||||||
this._userId,
|
this._userId,
|
||||||
);
|
);
|
||||||
@@ -217,6 +221,7 @@ Crypto.prototype.init = async function() {
|
|||||||
|
|
||||||
if (!myDevices[this._deviceId]) {
|
if (!myDevices[this._deviceId]) {
|
||||||
// add our own deviceinfo to the cryptoStore
|
// add our own deviceinfo to the cryptoStore
|
||||||
|
console.log("Crypto: adding this device to the store...");
|
||||||
const deviceInfo = {
|
const deviceInfo = {
|
||||||
keys: this._deviceKeys,
|
keys: this._deviceKeys,
|
||||||
algorithms: this._supportedAlgorithms,
|
algorithms: this._supportedAlgorithms,
|
||||||
@@ -231,6 +236,7 @@ Crypto.prototype.init = async function() {
|
|||||||
this._deviceList.saveIfDirty();
|
this._deviceList.saveIfDirty();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log("Crypto: checking for key backup...");
|
||||||
this._checkAndStartKeyBackup();
|
this._checkAndStartKeyBackup();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -694,6 +694,7 @@ function promiseifyTxn(txn) {
|
|||||||
if (txn._mx_abortexception !== undefined) {
|
if (txn._mx_abortexception !== undefined) {
|
||||||
reject(txn._mx_abortexception);
|
reject(txn._mx_abortexception);
|
||||||
} else {
|
} else {
|
||||||
|
console.log("Error performing indexeddb txn", event);
|
||||||
reject(event.target.error);
|
reject(event.target.error);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -90,6 +90,7 @@ export default class IndexedDBCryptoStore {
|
|||||||
};
|
};
|
||||||
|
|
||||||
req.onerror = (ev) => {
|
req.onerror = (ev) => {
|
||||||
|
console.log("Error connecting to indexeddb", ev);
|
||||||
reject(ev.target.error);
|
reject(ev.target.error);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -159,6 +160,7 @@ export default class IndexedDBCryptoStore {
|
|||||||
};
|
};
|
||||||
|
|
||||||
req.onerror = (ev) => {
|
req.onerror = (ev) => {
|
||||||
|
console.log("Error deleting data from indexeddb", ev);
|
||||||
reject(ev.target.error);
|
reject(ev.target.error);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user