Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d764abc1d1 | |||
| ee0f8abe71 | |||
| b45e231968 | |||
| c37db5ab9e | |||
| 77abc45489 |
@@ -1,3 +1,10 @@
|
||||
Changes in [0.9.2-cryptowraning.1](https://github.com/matrix-org/matrix-js-sdk/releases/tag/v0.9.2-cryptowraning.1) (2018-03-26)
|
||||
================================================================================================================================
|
||||
[Full Changelog](https://github.com/matrix-org/matrix-js-sdk/compare/v0.9.2...v0.9.2-cryptowraning.1)
|
||||
|
||||
* Disable crypto if indexeddb version too new
|
||||
[\#631](https://github.com/matrix-org/matrix-js-sdk/pull/631)
|
||||
|
||||
Changes in [0.9.2](https://github.com/matrix-org/matrix-js-sdk/releases/tag/v0.9.2) (2017-12-04)
|
||||
================================================================================================
|
||||
[Full Changelog](https://github.com/matrix-org/matrix-js-sdk/compare/v0.9.1...v0.9.2)
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "matrix-js-sdk",
|
||||
"version": "0.9.2",
|
||||
"version": "0.9.2-cryptowraning.1",
|
||||
"description": "Matrix Client-Server SDK for Javascript",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
|
||||
@@ -108,6 +108,12 @@ utils.inherits(Crypto, EventEmitter);
|
||||
* Returns a promise which resolves once the crypto module is ready for use.
|
||||
*/
|
||||
Crypto.prototype.init = async function() {
|
||||
// XXX: Connect to the backend now so we can fail faster if the
|
||||
// version is wrong
|
||||
if (this._cryptoStore._connect) {
|
||||
await this._cryptoStore._connect();
|
||||
}
|
||||
|
||||
await this._olmDevice.init();
|
||||
|
||||
// build our device keys: these will later be uploaded
|
||||
|
||||
@@ -91,6 +91,12 @@ export default class IndexedDBCryptoStore {
|
||||
resolve(new IndexedDBCryptoStoreBackend.Backend(db));
|
||||
};
|
||||
}).catch((e) => {
|
||||
// Don't fall back to memory in this case: we'd end up recreating
|
||||
// a new Olm account in memory and advertising new keys for the
|
||||
// same device.
|
||||
if (e.name == 'VersionError') {
|
||||
throw e;
|
||||
}
|
||||
console.warn(
|
||||
`unable to connect to indexeddb ${this._dbName}` +
|
||||
`: falling back to in-memory store: ${e}`,
|
||||
|
||||
Reference in New Issue
Block a user