Skip to content

Commit

Permalink
Fix truncating cdsi table
Browse files Browse the repository at this point in the history
Fixes #1587
  • Loading branch information
AsamK committed Sep 12, 2024
1 parent 352699c commit c6e9312
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
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;

Expand Down Expand Up @@ -254,7 +255,7 @@ private Map<String, RegisteredUser> getRegisteredUsersV2(
account.setLastRecipientsRefresh(System.currentTimeMillis());
}
});
} catch (CdsiInvalidTokenException e) {
} catch (CdsiInvalidTokenException | CdsiInvalidArgumentException e) {
account.setCdsiToken(null);
account.getCdsiStore().clearAll();
throw e;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ private static void updateLastSeen(
public void clearAll() {
final var sql = (
"""
TRUNCATE %s
DELETE FROM %s
"""
).formatted(TABLE_CDSI);
try (final var connection = database.getConnection()) {
Expand Down

0 comments on commit c6e9312

Please sign in to comment.