setProfileKey: Introduce 'reason' parameter for improved logging

This commit is contained in:
Scott Nonnenberg 2024-09-17 00:26:42 +10:00 committed by GitHub
parent c2e7f30988
commit b32dbf2c68
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 48 additions and 28 deletions

View file

@ -2008,14 +2008,22 @@ export class MessageModel extends window.Backbone.Model<MessageAttributesType> {
) {
conversation.set({ profileSharing: true });
} else if (isDirectConversation(conversation.attributes)) {
void conversation.setProfileKey(profileKey);
drop(
conversation.setProfileKey(profileKey, {
reason: 'handleDataMessage',
})
);
} else {
const local = window.ConversationController.lookupOrCreate({
e164: source,
serviceId: sourceServiceId,
reason: 'handleDataMessage:setProfileKey',
});
void local?.setProfileKey(profileKey);
drop(
local?.setProfileKey(profileKey, {
reason: 'handleDataMessage',
})
);
}
}