Skip to content

Degration of indexeddb to MemoryStore does not work anymore #2384

@schmop

Description

@schmop

Describe the bug
If the indexeddb throws an exception, normally the store would have degraded on a MemoryStore.
This does not longer work, because of the switch to the async-notation. The exceptions do not get caught and the degration will not be started.

To Reproduce
Steps to reproduce the behavior:

  1. Client startup with custom indexeddb in store
import db from './customindexeddb';

let opts = {
  store: new matrixcs.IndexedDBStore(
    indexeddb: db,
    dbName: 'matrix-store',
  ),
  baseUrl: "https://matrix.org",
};

var client = matrixcs.createClient(opts);
client.store.startup();
  1. customindexeddb is programmed to throw on reading from object stores
  2. MatrixClient crashes, but does not degrade to MemoryStore

Expected behavior
An error is thrown in the console, indexeddb will not be used anymore, and the backend store falls back to the MemoryStore.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions