mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 02:20:39 +00:00
Ignore failure when uploading PNI prekeys
Can happen if PNI identity key hasn't been sent to the server yet.
This commit is contained in:
parent
83d471818d
commit
c9002d9481
1 changed files with 6 additions and 0 deletions
|
@ -14,6 +14,7 @@ import org.slf4j.LoggerFactory;
|
||||||
import org.whispersystems.signalservice.api.account.PreKeyUpload;
|
import org.whispersystems.signalservice.api.account.PreKeyUpload;
|
||||||
import org.whispersystems.signalservice.api.push.ServiceIdType;
|
import org.whispersystems.signalservice.api.push.ServiceIdType;
|
||||||
import org.whispersystems.signalservice.api.push.exceptions.AuthorizationFailedException;
|
import org.whispersystems.signalservice.api.push.exceptions.AuthorizationFailedException;
|
||||||
|
import org.whispersystems.signalservice.api.push.exceptions.NonSuccessfulResponseCodeException;
|
||||||
import org.whispersystems.signalservice.internal.push.OneTimePreKeyCounts;
|
import org.whispersystems.signalservice.internal.push.OneTimePreKeyCounts;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
@ -171,6 +172,11 @@ public class PreKeyHelper {
|
||||||
} catch (AuthorizationFailedException e) {
|
} catch (AuthorizationFailedException e) {
|
||||||
// This can happen when the primary device has changed phone number
|
// This can happen when the primary device has changed phone number
|
||||||
logger.warn("Failed to updated pre keys: {}", e.getMessage());
|
logger.warn("Failed to updated pre keys: {}", e.getMessage());
|
||||||
|
} catch (NonSuccessfulResponseCodeException e) {
|
||||||
|
if (serviceIdType != ServiceIdType.PNI || e.getCode() != 422) {
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
|
logger.warn("Failed to update PNI pre keys, ignoring.");
|
||||||
}
|
}
|
||||||
return needsReset;
|
return needsReset;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue