Profile fetches shouldn't drop our own profile key
Co-authored-by: Fedor Indutny <79877362+indutny-signal@users.noreply.github.com>
This commit is contained in:
parent
34433f63e3
commit
36bb201537
|
@ -131,7 +131,9 @@ async function doGetProfile(c: ConversationModel): Promise<void> {
|
||||||
throw error;
|
throw error;
|
||||||
}
|
}
|
||||||
if (error.code === 401 || error.code === 403) {
|
if (error.code === 401 || error.code === 403) {
|
||||||
await c.setProfileKey(undefined);
|
if (!isMe(c.attributes)) {
|
||||||
|
await c.setProfileKey(undefined);
|
||||||
|
}
|
||||||
|
|
||||||
// Retry fetch using last known profileKeyVersion or fetch
|
// Retry fetch using last known profileKeyVersion or fetch
|
||||||
// unversioned profile.
|
// unversioned profile.
|
||||||
|
@ -306,7 +308,9 @@ async function doGetProfile(c: ConversationModel): Promise<void> {
|
||||||
log.warn(
|
log.warn(
|
||||||
`getProfile: Got 401/403 when using accessKey for ${idForLogging}, removing profileKey`
|
`getProfile: Got 401/403 when using accessKey for ${idForLogging}, removing profileKey`
|
||||||
);
|
);
|
||||||
c.setProfileKey(undefined);
|
if (!isMe(c.attributes)) {
|
||||||
|
await c.setProfileKey(undefined);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (c.get('sealedSender') === SEALED_SENDER.UNKNOWN) {
|
if (c.get('sealedSender') === SEALED_SENDER.UNKNOWN) {
|
||||||
log.warn(
|
log.warn(
|
||||||
|
@ -363,11 +367,8 @@ async function doGetProfile(c: ConversationModel): Promise<void> {
|
||||||
if (error instanceof HTTPError) {
|
if (error instanceof HTTPError) {
|
||||||
if (error.code === 403 || error.code === 404) {
|
if (error.code === 403 || error.code === 404) {
|
||||||
log.warn(
|
log.warn(
|
||||||
`getProfile: clearing profile avatar for conversation ${idForLogging}`
|
`getProfile: profile avatar is missing for conversation ${idForLogging}`
|
||||||
);
|
);
|
||||||
c.set({
|
|
||||||
profileAvatar: null,
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
log.warn(
|
log.warn(
|
||||||
|
|
Loading…
Reference in New Issue