diff --git a/src/matrix/storage/idb/stores/RoomMemberStore.ts b/src/matrix/storage/idb/stores/RoomMemberStore.ts index 847e8dae..6abd897f 100644 --- a/src/matrix/storage/idb/stores/RoomMemberStore.ts +++ b/src/matrix/storage/idb/stores/RoomMemberStore.ts @@ -78,10 +78,10 @@ export class RoomMemberStore { return userIds; } - removeAllForRoom(roomId: string): Promise { + removeAllForRoom(roomId: string): void { // exclude both keys as they are theoretical min and max, // but we should't have a match for just the room id, or room id with max const range = this._roomMembersStore.IDBKeyRange.bound(roomId, `${roomId}|${MAX_UNICODE}`, true, true); - return this._roomMembersStore.delete(range); + this._roomMembersStore.delete(range); } } diff --git a/src/matrix/storage/idb/stores/SessionStore.ts b/src/matrix/storage/idb/stores/SessionStore.ts index bf3d6d11..4dc467fe 100644 --- a/src/matrix/storage/idb/stores/SessionStore.ts +++ b/src/matrix/storage/idb/stores/SessionStore.ts @@ -34,15 +34,15 @@ export class SessionStore { } } - set(key: string, value: any): Promise { - return this._sessionStore.put({key, value}); + set(key: string, value: any): void { + this._sessionStore.put({key, value}); } - add(key: string, value: any): Promise { - return this._sessionStore.add({key, value}); + add(key: string, value: any): void { + this._sessionStore.add({key, value}); } - remove(key: IDBValidKey): Promise { - return this._sessionStore.delete(key); + remove(key: IDBValidKey): void { + this._sessionStore.delete(key); } } diff --git a/src/matrix/storage/idb/stores/TimelineEventStore.ts b/src/matrix/storage/idb/stores/TimelineEventStore.ts index 764b886b..a479efd7 100644 --- a/src/matrix/storage/idb/stores/TimelineEventStore.ts +++ b/src/matrix/storage/idb/stores/TimelineEventStore.ts @@ -262,23 +262,23 @@ export class TimelineEventStore { /** Inserts a new entry into the store. The combination of roomId and eventKey should not exist yet, or an error is thrown. * @param entry the entry to insert - * @return a promise resolving to undefined if the operation was successful, or a StorageError if not. + * @return nothing. To wait for the operation to finish, await the transaction it's part of. * @throws {StorageError} ... */ - insert(entry: StorageEntry): Promise { + insert(entry: StorageEntry): void { entry.key = encodeKey(entry.roomId, entry.fragmentId, entry.eventIndex); entry.eventIdKey = encodeEventIdKey(entry.roomId, entry.event.event_id); // TODO: map error? or in idb/store? - return this._timelineStore.add(entry); + this._timelineStore.add(entry); } /** Updates the entry into the store with the given [roomId, eventKey] combination. * If not yet present, will insert. Might be slower than add. * @param entry the entry to update. - * @return a promise resolving to undefined if the operation was successful, or a StorageError if not. + * @return nothing. To wait for the operation to finish, await the transaction it's part of. */ - update(entry: StorageEntry): Promise { - return this._timelineStore.put(entry); + update(entry: StorageEntry): void { + this._timelineStore.put(entry); } get(roomId: string, eventKey: EventKey): Promise { @@ -289,10 +289,10 @@ export class TimelineEventStore { return this._timelineStore.index("byEventId").get(encodeEventIdKey(roomId, eventId)); } - removeAllForRoom(roomId: string): Promise { + removeAllForRoom(roomId: string): void { const minKey = encodeKey(roomId, KeyLimits.minStorageKey, KeyLimits.minStorageKey); const maxKey = encodeKey(roomId, KeyLimits.maxStorageKey, KeyLimits.maxStorageKey); const range = this._timelineStore.IDBKeyRange.bound(minKey, maxKey); - return this._timelineStore.delete(range); + this._timelineStore.delete(range); } }