Added clearer debug logging to createOrLookup

This commit is contained in:
Alvaro 2022-12-02 18:05:27 -07:00 committed by GitHub
parent bc4f3dcd01
commit e41252b35e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
21 changed files with 55 additions and 4 deletions

View file

@ -107,6 +107,7 @@ export class MessageRequests extends Collection<MessageRequestModel> {
conversation = window.ConversationController.lookupOrCreate({
e164: threadE164,
uuid: threadUuid,
reason: 'MessageRequests.onResponse',
});
}

View file

@ -48,6 +48,7 @@ export class Reactions extends Collection<ReactionModel> {
const reactionsBySource = this.filter(re => {
const targetSender = window.ConversationController.lookupOrCreate({
uuid: re.get('targetAuthorUuid'),
reason: 'Reactions.forMessage',
});
const targetTimestamp = re.get('targetTimestamp');
return targetSender?.id === senderId && targetTimestamp === sentAt;
@ -92,6 +93,7 @@ export class Reactions extends Collection<ReactionModel> {
const targetAuthorConversation =
window.ConversationController.lookupOrCreate({
uuid: reaction.get('targetAuthorUuid'),
reason: 'Reactions.onReaction',
});
const targetConversationId = targetAuthorConversation?.id;
if (!targetConversationId) {

View file

@ -62,6 +62,7 @@ export class ReadSyncs extends Collection {
const sender = window.ConversationController.lookupOrCreate({
e164: message.get('source'),
uuid: message.get('sourceUuid'),
reason: 'ReadSyncs.forMessage',
});
const sync = this.find(item => {
return (
@ -88,6 +89,7 @@ export class ReadSyncs extends Collection {
const sender = window.ConversationController.lookupOrCreate({
e164: item.source,
uuid: item.sourceUuid,
reason: 'ReadSyncs.onSync',
});
return isIncoming(item) && sender?.id === sync.get('senderId');

View file

@ -41,6 +41,7 @@ export class ViewSyncs extends Collection {
const sender = window.ConversationController.lookupOrCreate({
e164: message.get('source'),
uuid: message.get('sourceUuid'),
reason: 'ViewSyncs.forMessage',
});
const syncs = this.filter(item => {
return (
@ -69,6 +70,7 @@ export class ViewSyncs extends Collection {
const sender = window.ConversationController.lookupOrCreate({
e164: item.source,
uuid: item.sourceUuid,
reason: 'ViewSyncs.onSync',
});
return sender?.id === sync.get('senderId');