]> nmode's Git Repositories - signal-cli/commitdiff
Fix truncating cdsi table
authorAsamK <asamk@gmx.de>
Thu, 12 Sep 2024 21:09:20 +0000 (23:09 +0200)
committerAsamK <asamk@gmx.de>
Thu, 12 Sep 2024 21:09:20 +0000 (23:09 +0200)
Fixes #1587

lib/src/main/java/org/asamk/signal/manager/helper/RecipientHelper.java
lib/src/main/java/org/asamk/signal/manager/storage/recipients/CdsiStore.java

index e003450b3cc455465bc83c98ea25c5683923c1a2..24b3eb5f355ce09fbba9c2320ba83e3216158c58 100644 (file)
@@ -14,6 +14,7 @@ import org.whispersystems.signalservice.api.push.ServiceId;
 import org.whispersystems.signalservice.api.push.ServiceId.ACI;
 import org.whispersystems.signalservice.api.push.ServiceId.PNI;
 import org.whispersystems.signalservice.api.push.SignalServiceAddress;
+import org.whispersystems.signalservice.api.push.exceptions.CdsiInvalidArgumentException;
 import org.whispersystems.signalservice.api.push.exceptions.CdsiInvalidTokenException;
 import org.whispersystems.signalservice.api.services.CdsiV2Service;
 
@@ -254,7 +255,7 @@ public class RecipientHelper {
                                     account.setLastRecipientsRefresh(System.currentTimeMillis());
                                 }
                             });
-        } catch (CdsiInvalidTokenException e) {
+        } catch (CdsiInvalidTokenException | CdsiInvalidArgumentException e) {
             account.setCdsiToken(null);
             account.getCdsiStore().clearAll();
             throw e;
index fd0846e910a7f59d308fa30b88a40e3f4533414f..1170e6513f7d78569cd832656a91dcf124235161 100644 (file)
@@ -156,7 +156,7 @@ public class CdsiStore {
     public void clearAll() {
         final var sql = (
                 """
-                TRUNCATE %s
+                DELETE FROM %s
                 """
         ).formatted(TABLE_CDSI);
         try (final var connection = database.getConnection()) {