fix stores returning the delete promise which isn't returned anymore

I checked these aren't awaited in any js file
This commit is contained in:
Bruno Windels 2021-09-17 18:24:24 +02:00
parent ad45016b87
commit f5467a653c
12 changed files with 30 additions and 30 deletions

View file

@ -78,14 +78,14 @@ export class DeviceIdentityStore {
return this._store.index("byCurve25519Key").get(curve25519Key); return this._store.index("byCurve25519Key").get(curve25519Key);
} }
remove(userId: string, deviceId: string): Promise<undefined> { remove(userId: string, deviceId: string): void {
return this._store.delete(encodeKey(userId, deviceId)); this._store.delete(encodeKey(userId, deviceId));
} }
removeAllForUser(userId: string): Promise<undefined> { removeAllForUser(userId: string): void {
// exclude both keys as they are theoretical min and max, // 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 // 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); 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);
} }
} }

View file

@ -44,11 +44,11 @@ export class GroupSessionDecryptionStore {
this._store.put(decryption as GroupSessionEntry); this._store.put(decryption as GroupSessionEntry);
} }
removeAllForRoom(roomId: string): Promise<undefined> { removeAllForRoom(roomId: string): void {
const range = this._store.IDBKeyRange.bound( const range = this._store.IDBKeyRange.bound(
encodeKey(roomId, MIN_UNICODE, MIN_UNICODE), encodeKey(roomId, MIN_UNICODE, MIN_UNICODE),
encodeKey(roomId, MAX_UNICODE, MAX_UNICODE) encodeKey(roomId, MAX_UNICODE, MAX_UNICODE)
); );
return this._store.delete(range); this._store.delete(range);
} }
} }

View file

@ -53,11 +53,11 @@ export class InboundGroupSessionStore {
this._store.put(session); this._store.put(session);
} }
removeAllForRoom(roomId: string): Promise<undefined> { removeAllForRoom(roomId: string) {
const range = this._store.IDBKeyRange.bound( const range = this._store.IDBKeyRange.bound(
encodeKey(roomId, MIN_UNICODE, MIN_UNICODE), encodeKey(roomId, MIN_UNICODE, MIN_UNICODE),
encodeKey(roomId, MAX_UNICODE, MAX_UNICODE) encodeKey(roomId, MAX_UNICODE, MAX_UNICODE)
); );
return this._store.delete(range); this._store.delete(range);
} }
} }

View file

@ -71,7 +71,7 @@ export class OlmSessionStore {
this._store.put(session as OlmSessionEntry); this._store.put(session as OlmSessionEntry);
} }
remove(senderKey: string, sessionId: string): Promise<undefined> { remove(senderKey: string, sessionId: string): void {
return this._store.delete(encodeKey(senderKey, sessionId)); this._store.delete(encodeKey(senderKey, sessionId));
} }
} }

View file

@ -73,8 +73,8 @@ export class OperationStore {
this._store.put(operation as OperationEntry); this._store.put(operation as OperationEntry);
} }
remove(id: string): Promise<undefined> { remove(id: string): void {
return this._store.delete(id); this._store.delete(id);
} }
async removeAllForScope(scope: string): Promise<undefined> { async removeAllForScope(scope: string): Promise<undefined> {

View file

@ -28,8 +28,8 @@ export class OutboundGroupSessionStore {
this._store = store; this._store = store;
} }
remove(roomId: string): Promise<undefined> { remove(roomId: string): void {
return this._store.delete(roomId); this._store.delete(roomId);
} }
get(roomId: string): Promise<OutboundSession | null> { get(roomId: string): Promise<OutboundSession | null> {

View file

@ -62,9 +62,9 @@ export class PendingEventStore {
} }
} }
remove(roomId: string, queueIndex: number): Promise<undefined> { remove(roomId: string, queueIndex: number) {
const keyRange = this._eventStore.IDBKeyRange.only(encodeKey(roomId, queueIndex)); 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<boolean> { async exists(roomId: string, queueIndex: number): Promise<boolean> {
@ -86,10 +86,10 @@ export class PendingEventStore {
return this._eventStore.selectAll(); return this._eventStore.selectAll();
} }
removeAllForRoom(roomId: string): Promise<undefined> { removeAllForRoom(roomId: string): void {
const minKey = encodeKey(roomId, KeyLimits.minStorageKey); const minKey = encodeKey(roomId, KeyLimits.minStorageKey);
const maxKey = encodeKey(roomId, KeyLimits.maxStorageKey); const maxKey = encodeKey(roomId, KeyLimits.maxStorageKey);
const range = this._eventStore.IDBKeyRange.bound(minKey, maxKey); const range = this._eventStore.IDBKeyRange.bound(minKey, maxKey);
return this._eventStore.delete(range); this._eventStore.delete(range);
} }
} }

View file

@ -47,10 +47,10 @@ export class RoomStateStore {
this._roomStateStore.put(entry); this._roomStateStore.put(entry);
} }
removeAllForRoom(roomId: string): Promise<undefined> { removeAllForRoom(roomId: string): void {
// exclude both keys as they are theoretical min and max, // 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 // 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); const range = this._roomStateStore.IDBKeyRange.bound(roomId, `${roomId}|${MAX_UNICODE}`, true, true);
return this._roomStateStore.delete(range); this._roomStateStore.delete(range);
} }
} }

View file

@ -55,7 +55,7 @@ export class RoomSummaryStore {
return roomId === fetchedKey; return roomId === fetchedKey;
} }
remove(roomId: string): Promise<undefined> { remove(roomId: string): void {
return this._summaryStore.delete(roomId); this._summaryStore.delete(roomId);
} }
} }

View file

@ -87,7 +87,7 @@ export class TimelineFragmentStore {
return this._store.get(encodeKey(roomId, fragmentId)); return this._store.get(encodeKey(roomId, fragmentId));
} }
removeAllForRoom(roomId: string): Promise<undefined> { removeAllForRoom(roomId: string): void {
return this._store.delete(this._allRange(roomId)); this._store.delete(this._allRange(roomId));
} }
} }

View file

@ -43,18 +43,18 @@ export class TimelineRelationStore {
this._store.add({key: encodeKey(roomId, targetEventId, relType, sourceEventId)}); this._store.add({key: encodeKey(roomId, targetEventId, relType, sourceEventId)});
} }
remove(roomId: string, targetEventId: string, relType: string, sourceEventId: string): Promise<undefined> { remove(roomId: string, targetEventId: string, relType: string, sourceEventId: string): void {
return this._store.delete(encodeKey(roomId, targetEventId, relType, sourceEventId)); this._store.delete(encodeKey(roomId, targetEventId, relType, sourceEventId));
} }
removeAllForTarget(roomId: string, targetId: string): Promise<undefined> { removeAllForTarget(roomId: string, targetId: string): void {
const range = this._store.IDBKeyRange.bound( const range = this._store.IDBKeyRange.bound(
encodeKey(roomId, targetId, MIN_UNICODE, MIN_UNICODE), encodeKey(roomId, targetId, MIN_UNICODE, MIN_UNICODE),
encodeKey(roomId, targetId, MAX_UNICODE, MAX_UNICODE), encodeKey(roomId, targetId, MAX_UNICODE, MAX_UNICODE),
true, true,
true true
); );
return this._store.delete(range); this._store.delete(range);
} }
async getForTargetAndType(roomId: string, targetId: string, relType: string): Promise<RelationEntry[]> { async getForTargetAndType(roomId: string, targetId: string, relType: string): Promise<RelationEntry[]> {

View file

@ -36,7 +36,7 @@ export class UserIdentityStore {
this._store.put(userIdentity); this._store.put(userIdentity);
} }
remove(userId: string): Promise<undefined> { remove(userId: string): void {
return this._store.delete(userId); this._store.delete(userId);
} }
} }