mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2025-02-08 18:48:18 +01:00
log amount of marked user identities in migration
This commit is contained in:
parent
2563aa23e1
commit
08984ad1bc
@ -280,7 +280,7 @@ function createCallStore(db: IDBDatabase) : void {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//v18 add crossSigningKeys store, rename deviceIdentities to deviceKeys and empties userIdentities
|
//v18 add crossSigningKeys store, rename deviceIdentities to deviceKeys and empties userIdentities
|
||||||
async function applyCrossSigningChanges(db: IDBDatabase, txn: IDBTransaction) : Promise<void> {
|
async function applyCrossSigningChanges(db: IDBDatabase, txn: IDBTransaction, localStorage: IDOMStorage, log: ILogItem) : Promise<void> {
|
||||||
db.createObjectStore("crossSigningKeys", {keyPath: "key"});
|
db.createObjectStore("crossSigningKeys", {keyPath: "key"});
|
||||||
db.deleteObjectStore("deviceIdentities");
|
db.deleteObjectStore("deviceIdentities");
|
||||||
const deviceKeys = db.createObjectStore("deviceKeys", {keyPath: "key"});
|
const deviceKeys = db.createObjectStore("deviceKeys", {keyPath: "key"});
|
||||||
@ -288,10 +288,13 @@ async function applyCrossSigningChanges(db: IDBDatabase, txn: IDBTransaction) :
|
|||||||
// mark all userIdentities as outdated as cross-signing keys won't be stored
|
// mark all userIdentities as outdated as cross-signing keys won't be stored
|
||||||
// also rename the deviceTrackingStatus field to keysTrackingStatus
|
// also rename the deviceTrackingStatus field to keysTrackingStatus
|
||||||
const userIdentities = txn.objectStore("userIdentities");
|
const userIdentities = txn.objectStore("userIdentities");
|
||||||
|
let counter = 0;
|
||||||
await iterateCursor<UserIdentity>(userIdentities.openCursor(), (value, key, cursor) => {
|
await iterateCursor<UserIdentity>(userIdentities.openCursor(), (value, key, cursor) => {
|
||||||
delete value["deviceTrackingStatus"];
|
delete value["deviceTrackingStatus"];
|
||||||
value.keysTrackingStatus = KeysTrackingStatus.Outdated;
|
value.keysTrackingStatus = KeysTrackingStatus.Outdated;
|
||||||
cursor.update(value);
|
cursor.update(value);
|
||||||
|
counter += 1;
|
||||||
return NOT_DONE;
|
return NOT_DONE;
|
||||||
});
|
});
|
||||||
|
log.set("marked_outdated", counter);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user