From 3f1adec61444af4f2ad46256d72af422f79f1f39 Mon Sep 17 00:00:00 2001 From: Scott Nonnenberg Date: Wed, 11 Aug 2021 13:11:31 -0700 Subject: [PATCH] removeAllConfiguration: Use json_remove instead of json_patch --- ts/sql/Server.ts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/ts/sql/Server.ts b/ts/sql/Server.ts index cb9bdf7a096..6f2f38c85a3 100644 --- a/ts/sql/Server.ts +++ b/ts/sql/Server.ts @@ -5369,7 +5369,6 @@ async function removeAll(): Promise { // Anything that isn't user-visible data async function removeAllConfiguration(): Promise { const db = getInstance(); - const patch: Partial = { senderKeyInfo: undefined }; db.transaction(() => { db.exec( @@ -5384,10 +5383,8 @@ async function removeAllConfiguration(): Promise { 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');" ); })(); }