removeAllConfiguration: Use json_remove instead of json_patch

This commit is contained in:
Scott Nonnenberg 2021-08-11 13:11:31 -07:00 committed by GitHub
parent 61b7eebfcf
commit 3f1adec614
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -5369,7 +5369,6 @@ async function removeAll(): Promise<void> {
// Anything that isn't user-visible data
async function removeAllConfiguration(): Promise<void> {
const db = getInstance();
const patch: Partial<ConversationType> = { senderKeyInfo: undefined };
db.transaction(() => {
db.exec(
@ -5384,10 +5383,8 @@ async function removeAllConfiguration(): Promise<void> {
DELETE FROM jobs;
`
);
db.prepare('UPDATE conversations SET json = json_patch(json, $patch);').run(
{
patch: JSON.stringify(patch),
}
db.exec(
"UPDATE conversations SET json = json_remove(json, '$.senderKeyInfo');"
);
})();
}