diff --git a/src/matrix/storage/idb/stores/DeviceIdentityStore.ts b/src/matrix/storage/idb/stores/DeviceIdentityStore.ts index 9800fcca..6b9f5332 100644 --- a/src/matrix/storage/idb/stores/DeviceIdentityStore.ts +++ b/src/matrix/storage/idb/stores/DeviceIdentityStore.ts @@ -78,14 +78,14 @@ export class DeviceIdentityStore { return this._store.index("byCurve25519Key").get(curve25519Key); } - remove(userId: string, deviceId: string): Promise { - return this._store.delete(encodeKey(userId, deviceId)); + remove(userId: string, deviceId: string): void { + this._store.delete(encodeKey(userId, deviceId)); } - removeAllForUser(userId: string): Promise { + removeAllForUser(userId: 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._store.IDBKeyRange.bound(encodeKey(userId, MIN_UNICODE), encodeKey(userId, MAX_UNICODE), true, true); - return this._store.delete(range); + this._store.delete(range); } } diff --git a/src/matrix/storage/idb/stores/GroupSessionDecryptionStore.ts b/src/matrix/storage/idb/stores/GroupSessionDecryptionStore.ts index b6636f13..1627e44a 100644 --- a/src/matrix/storage/idb/stores/GroupSessionDecryptionStore.ts +++ b/src/matrix/storage/idb/stores/GroupSessionDecryptionStore.ts @@ -44,11 +44,11 @@ export class GroupSessionDecryptionStore { this._store.put(decryption as GroupSessionEntry); } - removeAllForRoom(roomId: string): Promise { + removeAllForRoom(roomId: string): void { const range = this._store.IDBKeyRange.bound( encodeKey(roomId, MIN_UNICODE, MIN_UNICODE), encodeKey(roomId, MAX_UNICODE, MAX_UNICODE) ); - return this._store.delete(range); + this._store.delete(range); } } diff --git a/src/matrix/storage/idb/stores/InboundGroupSessionStore.ts b/src/matrix/storage/idb/stores/InboundGroupSessionStore.ts index 286eaf4e..5dc0205f 100644 --- a/src/matrix/storage/idb/stores/InboundGroupSessionStore.ts +++ b/src/matrix/storage/idb/stores/InboundGroupSessionStore.ts @@ -53,11 +53,11 @@ export class InboundGroupSessionStore { this._store.put(session); } - removeAllForRoom(roomId: string): Promise { + removeAllForRoom(roomId: string) { const range = this._store.IDBKeyRange.bound( encodeKey(roomId, MIN_UNICODE, MIN_UNICODE), encodeKey(roomId, MAX_UNICODE, MAX_UNICODE) ); - return this._store.delete(range); + this._store.delete(range); } } diff --git a/src/matrix/storage/idb/stores/OlmSessionStore.ts b/src/matrix/storage/idb/stores/OlmSessionStore.ts index 1daa0b21..3310215e 100644 --- a/src/matrix/storage/idb/stores/OlmSessionStore.ts +++ b/src/matrix/storage/idb/stores/OlmSessionStore.ts @@ -71,7 +71,7 @@ export class OlmSessionStore { this._store.put(session as OlmSessionEntry); } - remove(senderKey: string, sessionId: string): Promise { - return this._store.delete(encodeKey(senderKey, sessionId)); + remove(senderKey: string, sessionId: string): void { + this._store.delete(encodeKey(senderKey, sessionId)); } } diff --git a/src/matrix/storage/idb/stores/OperationStore.ts b/src/matrix/storage/idb/stores/OperationStore.ts index cccd8e2d..0e103e8c 100644 --- a/src/matrix/storage/idb/stores/OperationStore.ts +++ b/src/matrix/storage/idb/stores/OperationStore.ts @@ -73,8 +73,8 @@ export class OperationStore { this._store.put(operation as OperationEntry); } - remove(id: string): Promise { - return this._store.delete(id); + remove(id: string): void { + this._store.delete(id); } async removeAllForScope(scope: string): Promise { diff --git a/src/matrix/storage/idb/stores/OutboundGroupSessionStore.ts b/src/matrix/storage/idb/stores/OutboundGroupSessionStore.ts index 82a87625..9712c717 100644 --- a/src/matrix/storage/idb/stores/OutboundGroupSessionStore.ts +++ b/src/matrix/storage/idb/stores/OutboundGroupSessionStore.ts @@ -28,8 +28,8 @@ export class OutboundGroupSessionStore { this._store = store; } - remove(roomId: string): Promise { - return this._store.delete(roomId); + remove(roomId: string): void { + this._store.delete(roomId); } get(roomId: string): Promise { diff --git a/src/matrix/storage/idb/stores/PendingEventStore.ts b/src/matrix/storage/idb/stores/PendingEventStore.ts index 01991ce8..d4bef05a 100644 --- a/src/matrix/storage/idb/stores/PendingEventStore.ts +++ b/src/matrix/storage/idb/stores/PendingEventStore.ts @@ -62,9 +62,9 @@ export class PendingEventStore { } } - remove(roomId: string, queueIndex: number): Promise { + remove(roomId: string, queueIndex: number) { const keyRange = this._eventStore.IDBKeyRange.only(encodeKey(roomId, queueIndex)); - return this._eventStore.delete(keyRange); + this._eventStore.delete(keyRange); } async exists(roomId: string, queueIndex: number): Promise { @@ -86,10 +86,10 @@ export class PendingEventStore { return this._eventStore.selectAll(); } - removeAllForRoom(roomId: string): Promise { + removeAllForRoom(roomId: string): void { const minKey = encodeKey(roomId, KeyLimits.minStorageKey); const maxKey = encodeKey(roomId, KeyLimits.maxStorageKey); const range = this._eventStore.IDBKeyRange.bound(minKey, maxKey); - return this._eventStore.delete(range); + this._eventStore.delete(range); } } diff --git a/src/matrix/storage/idb/stores/RoomStateStore.ts b/src/matrix/storage/idb/stores/RoomStateStore.ts index 441d61e4..b7ece0f7 100644 --- a/src/matrix/storage/idb/stores/RoomStateStore.ts +++ b/src/matrix/storage/idb/stores/RoomStateStore.ts @@ -47,10 +47,10 @@ export class RoomStateStore { this._roomStateStore.put(entry); } - 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._roomStateStore.IDBKeyRange.bound(roomId, `${roomId}|${MAX_UNICODE}`, true, true); - return this._roomStateStore.delete(range); + this._roomStateStore.delete(range); } } diff --git a/src/matrix/storage/idb/stores/RoomSummaryStore.ts b/src/matrix/storage/idb/stores/RoomSummaryStore.ts index bd911572..43c62fdb 100644 --- a/src/matrix/storage/idb/stores/RoomSummaryStore.ts +++ b/src/matrix/storage/idb/stores/RoomSummaryStore.ts @@ -55,7 +55,7 @@ export class RoomSummaryStore { return roomId === fetchedKey; } - remove(roomId: string): Promise { - return this._summaryStore.delete(roomId); + remove(roomId: string): void { + this._summaryStore.delete(roomId); } } diff --git a/src/matrix/storage/idb/stores/TimelineFragmentStore.ts b/src/matrix/storage/idb/stores/TimelineFragmentStore.ts index 813fc3f3..5753a93e 100644 --- a/src/matrix/storage/idb/stores/TimelineFragmentStore.ts +++ b/src/matrix/storage/idb/stores/TimelineFragmentStore.ts @@ -87,7 +87,7 @@ export class TimelineFragmentStore { return this._store.get(encodeKey(roomId, fragmentId)); } - removeAllForRoom(roomId: string): Promise { - return this._store.delete(this._allRange(roomId)); + removeAllForRoom(roomId: string): void { + this._store.delete(this._allRange(roomId)); } } diff --git a/src/matrix/storage/idb/stores/TimelineRelationStore.ts b/src/matrix/storage/idb/stores/TimelineRelationStore.ts index 6772864a..88ef86ae 100644 --- a/src/matrix/storage/idb/stores/TimelineRelationStore.ts +++ b/src/matrix/storage/idb/stores/TimelineRelationStore.ts @@ -43,18 +43,18 @@ export class TimelineRelationStore { this._store.add({key: encodeKey(roomId, targetEventId, relType, sourceEventId)}); } - remove(roomId: string, targetEventId: string, relType: string, sourceEventId: string): Promise { - return this._store.delete(encodeKey(roomId, targetEventId, relType, sourceEventId)); + remove(roomId: string, targetEventId: string, relType: string, sourceEventId: string): void { + this._store.delete(encodeKey(roomId, targetEventId, relType, sourceEventId)); } - removeAllForTarget(roomId: string, targetId: string): Promise { + removeAllForTarget(roomId: string, targetId: string): void { const range = this._store.IDBKeyRange.bound( encodeKey(roomId, targetId, MIN_UNICODE, MIN_UNICODE), encodeKey(roomId, targetId, MAX_UNICODE, MAX_UNICODE), true, true ); - return this._store.delete(range); + this._store.delete(range); } async getForTargetAndType(roomId: string, targetId: string, relType: string): Promise { diff --git a/src/matrix/storage/idb/stores/UserIdentityStore.ts b/src/matrix/storage/idb/stores/UserIdentityStore.ts index 1d94a666..692d8384 100644 --- a/src/matrix/storage/idb/stores/UserIdentityStore.ts +++ b/src/matrix/storage/idb/stores/UserIdentityStore.ts @@ -36,7 +36,7 @@ export class UserIdentityStore { this._store.put(userIdentity); } - remove(userId: string): Promise { - return this._store.delete(userId); + remove(userId: string): void { + this._store.delete(userId); } }