Keep profileKey in situations where it didn't work; still fail over

This commit is contained in:
Scott Nonnenberg 2024-12-10 10:55:33 +10:00 committed by GitHub
parent b72fb50ea0
commit 0eb4bd86bd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 55 additions and 95 deletions

View file

@ -108,19 +108,7 @@ function processError(error: unknown): void {
'private'
);
if (error.code === 401 || error.code === 403) {
if (
conversation.get('sealedSender') === SEALED_SENDER.ENABLED ||
conversation.get('sealedSender') === SEALED_SENDER.UNRESTRICTED
) {
log.warn(
`handleMessageSend: Got 401/403 for ${conversation.idForLogging()}, removing profile key`
);
void conversation.setProfileKey(undefined, {
reason: 'handleMessageSend/processError',
});
}
if (conversation.get('sealedSender') === SEALED_SENDER.UNKNOWN) {
if (conversation.get('sealedSender') !== SEALED_SENDER.DISABLED) {
log.warn(
`handleMessageSend: Got 401/403 for ${conversation.idForLogging()}, setting sealedSender = DISABLED`
);