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:
parent
ad45016b87
commit
f5467a653c
12 changed files with 30 additions and 30 deletions
|
@ -78,14 +78,14 @@ export class DeviceIdentityStore {
|
|||
return this._store.index("byCurve25519Key").get(curve25519Key);
|
||||
}
|
||||
|
||||
remove(userId: string, deviceId: string): Promise<undefined> {
|
||||
return this._store.delete(encodeKey(userId, deviceId));
|
||||
remove(userId: string, deviceId: string): void {
|
||||
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,
|
||||
// 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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -44,11 +44,11 @@ export class GroupSessionDecryptionStore {
|
|||
this._store.put(decryption as GroupSessionEntry);
|
||||
}
|
||||
|
||||
removeAllForRoom(roomId: string): Promise<undefined> {
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -53,11 +53,11 @@ export class InboundGroupSessionStore {
|
|||
this._store.put(session);
|
||||
}
|
||||
|
||||
removeAllForRoom(roomId: string): Promise<undefined> {
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -71,7 +71,7 @@ export class OlmSessionStore {
|
|||
this._store.put(session as OlmSessionEntry);
|
||||
}
|
||||
|
||||
remove(senderKey: string, sessionId: string): Promise<undefined> {
|
||||
return this._store.delete(encodeKey(senderKey, sessionId));
|
||||
remove(senderKey: string, sessionId: string): void {
|
||||
this._store.delete(encodeKey(senderKey, sessionId));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -73,8 +73,8 @@ export class OperationStore {
|
|||
this._store.put(operation as OperationEntry);
|
||||
}
|
||||
|
||||
remove(id: string): Promise<undefined> {
|
||||
return this._store.delete(id);
|
||||
remove(id: string): void {
|
||||
this._store.delete(id);
|
||||
}
|
||||
|
||||
async removeAllForScope(scope: string): Promise<undefined> {
|
||||
|
|
|
@ -28,8 +28,8 @@ export class OutboundGroupSessionStore {
|
|||
this._store = store;
|
||||
}
|
||||
|
||||
remove(roomId: string): Promise<undefined> {
|
||||
return this._store.delete(roomId);
|
||||
remove(roomId: string): void {
|
||||
this._store.delete(roomId);
|
||||
}
|
||||
|
||||
get(roomId: string): Promise<OutboundSession | null> {
|
||||
|
|
|
@ -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));
|
||||
return this._eventStore.delete(keyRange);
|
||||
this._eventStore.delete(keyRange);
|
||||
}
|
||||
|
||||
async exists(roomId: string, queueIndex: number): Promise<boolean> {
|
||||
|
@ -86,10 +86,10 @@ export class PendingEventStore {
|
|||
return this._eventStore.selectAll();
|
||||
}
|
||||
|
||||
removeAllForRoom(roomId: string): Promise<undefined> {
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -47,10 +47,10 @@ export class RoomStateStore {
|
|||
this._roomStateStore.put(entry);
|
||||
}
|
||||
|
||||
removeAllForRoom(roomId: string): Promise<undefined> {
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -55,7 +55,7 @@ export class RoomSummaryStore {
|
|||
return roomId === fetchedKey;
|
||||
}
|
||||
|
||||
remove(roomId: string): Promise<undefined> {
|
||||
return this._summaryStore.delete(roomId);
|
||||
remove(roomId: string): void {
|
||||
this._summaryStore.delete(roomId);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -87,7 +87,7 @@ export class TimelineFragmentStore {
|
|||
return this._store.get(encodeKey(roomId, fragmentId));
|
||||
}
|
||||
|
||||
removeAllForRoom(roomId: string): Promise<undefined> {
|
||||
return this._store.delete(this._allRange(roomId));
|
||||
removeAllForRoom(roomId: string): void {
|
||||
this._store.delete(this._allRange(roomId));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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<undefined> {
|
||||
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<undefined> {
|
||||
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<RelationEntry[]> {
|
||||
|
|
|
@ -36,7 +36,7 @@ export class UserIdentityStore {
|
|||
this._store.put(userIdentity);
|
||||
}
|
||||
|
||||
remove(userId: string): Promise<undefined> {
|
||||
return this._store.delete(userId);
|
||||
remove(userId: string): void {
|
||||
this._store.delete(userId);
|
||||
}
|
||||
}
|
||||
|
|
Reference in a new issue