1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-28 05:03:59 +03:00

remove count logging, approach confirmed to work and be according to idb spec

This commit is contained in:
Bruno Windels
2018-09-03 10:27:00 +02:00
parent ebc162e3d8
commit 3bed5969bf

View File

@@ -317,8 +317,6 @@ LocalIndexedDBStoreBackend.prototype = {
const roomIndex = store.index("room");
const roomRange = IDBKeyRange.only(roomId);
const indexCount = (await reqAsPromise(roomIndex.count(roomRange))).result;
const minStateKeyProm = reqAsCursorPromise(
roomIndex.openKeyCursor(roomRange, "next"),
).then((cursor) => cursor && cursor.primaryKey[1]);
@@ -336,17 +334,8 @@ LocalIndexedDBStoreBackend.prototype = {
[roomId, minStateKey],
[roomId, maxStateKey],
);
const count =
(await reqAsPromise(writeStore.count(membersKeyRange))).result;
// Leaving this for now to make sure
if (count !== indexCount) {
console.error(`not deleting all members, ` +
`oob_membership_events and its index room ` +
`dont seem to have the same key order`);
}
console.log(`LL: Deleting ${count} users + marker for ` +
console.log(`LL: Deleting all users + marker in storage for ` +
`room ${roomId}, with key range:`,
[roomId, minStateKey], [roomId, maxStateKey]);
await reqAsPromise(writeStore.delete(membersKeyRange));