use idb key range to select non-backed up keys

This commit is contained in:
Bruno Windels 2022-01-28 13:11:32 +01:00
parent a499689bd8
commit b30db544a3

View file

@ -81,7 +81,7 @@ export class InboundGroupSessionStore {
}
getFirstNonBackedUpSessions(amount: number): Promise<InboundGroupSessionEntry[]> {
return this._store.index("byBackup").selectLimit(0, amount);
return this._store.index("byBackup").selectLimit(this._store.IDBKeyRange.only(BackupStatus.NotBackedUp), amount);
}
async markAsBackedUp(roomId: string, senderKey: string, sessionId: string): Promise<void> {