1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-29 16:43:09 +03:00

Merge remote-tracking branch 'origin/develop' into dbkr/wasm

This commit is contained in:
David Baker
2018-10-09 10:47:11 +01:00
4 changed files with 15 additions and 3 deletions

View File

@@ -49,6 +49,10 @@ import {InvalidStoreError} from './errors';
import Crypto from './crypto'; import Crypto from './crypto';
import { isCryptoAvailable } from './crypto'; import { isCryptoAvailable } from './crypto';
// Disable warnings for now: we use deprecated bluebird functions
// and need to migrate, but they spam the console with warnings.
Promise.config({warnings: false});
const LAZY_LOADING_MESSAGES_FILTER = { const LAZY_LOADING_MESSAGES_FILTER = {
lazy_load_members: true, lazy_load_members: true,
}; };

View File

@@ -198,7 +198,10 @@ utils.inherits(Room, EventEmitter);
*/ */
Room.prototype.getVersion = function() { Room.prototype.getVersion = function() {
const createEvent = this.currentState.getStateEvents("m.room.create", ""); const createEvent = this.currentState.getStateEvents("m.room.create", "");
if (!createEvent) return null; if (!createEvent) {
console.warn("Room " + this.room_id + " does not have an m.room.create event");
return '1';
}
const ver = createEvent.getContent()['room_version']; const ver = createEvent.getContent()['room_version'];
if (ver === undefined) return '1'; if (ver === undefined) return '1';
return ver; return ver;

View File

@@ -184,7 +184,9 @@ RemoteIndexedDBStoreBackend.prototype = {
if (msg.command == 'cmd_success') { if (msg.command == 'cmd_success') {
def.resolve(msg.result); def.resolve(msg.result);
} else { } else {
def.reject(msg.error); const error = new Error(msg.error.message);
error.name = msg.error.name;
def.reject(error);
} }
} else { } else {
console.warn("Unrecognised message from worker: " + msg); console.warn("Unrecognised message from worker: " + msg);

View File

@@ -135,7 +135,10 @@ class IndexedDBStoreWorker {
command: 'cmd_fail', command: 'cmd_fail',
seq: msg.seq, seq: msg.seq,
// Just send a string because Error objects aren't cloneable // Just send a string because Error objects aren't cloneable
error: "Error running command", error: {
message: err.message,
name: err.name,
},
}); });
}); });
} }