From 9fd191ae00d963aa5483eecff1fe94bb820893ef Mon Sep 17 00:00:00 2001 From: Evan Hahn <69474926+EvanHahn-Signal@users.noreply.github.com> Date: Thu, 12 Aug 2021 11:20:22 -0500 Subject: [PATCH] Add more logging for view-once message interactions --- ts/components/conversation/Message.tsx | 5 ++++- ts/views/conversation_view.ts | 13 +++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/ts/components/conversation/Message.tsx b/ts/components/conversation/Message.tsx index 3d9f7321f..02316d54d 100644 --- a/ts/components/conversation/Message.tsx +++ b/ts/components/conversation/Message.tsx @@ -2084,13 +2084,16 @@ export class Message extends React.PureComponent { const isAttachmentPending = this.isAttachmentPending(); - // Don't show lightbox for GIFs if (isGIF(attachments)) { + window.log.info(" handleOpen: lightbox doesn't open for GIFs"); return; } if (isTapToView) { if (isAttachmentPending) { + window.log.info( + ' handleOpen: tap-to-view attachment is pending; not showing the lightbox' + ); return; } diff --git a/ts/views/conversation_view.ts b/ts/views/conversation_view.ts index aa8fc3766..01827fea4 100644 --- a/ts/views/conversation_view.ts +++ b/ts/views/conversation_view.ts @@ -889,9 +889,15 @@ Whisper.ConversationView = Whisper.View.extend({ this.showSafetyNumber(contactId); }; const showExpiredIncomingTapToViewToast = () => { + window.log.info( + 'Showing expired tap-to-view toast for an incoming message' + ); this.showToast(Whisper.TapToViewExpiredIncomingToast); }; const showExpiredOutgoingTapToViewToast = () => { + window.log.info( + 'Showing expired tap-to-view toast for an outgoing message' + ); this.showToast(Whisper.TapToViewExpiredOutgoingToast); }; const showForwardMessageModal = this.showForwardMessageModal.bind(this); @@ -2798,6 +2804,8 @@ Whisper.ConversationView = Whisper.View.extend({ }, async displayTapToViewMessage(messageId: string) { + window.log.info('displayTapToViewMessage: attempting to display message'); + const message = window.MessageController.getById(messageId); if (!message) { throw new Error(`displayTapToViewMessage: Message ${messageId} missing!`); @@ -2832,7 +2840,10 @@ Whisper.ConversationView = Whisper.View.extend({ await message.markViewOnceMessageViewed(); const closeLightbox = async () => { + window.log.info('displayTapToViewMessage: attempting to close lightbox'); + if (!this.lightboxView) { + window.log.info('displayTapToViewMessage: lightbox was already closed'); return; } @@ -2870,6 +2881,8 @@ Whisper.ConversationView = Whisper.View.extend({ }); window.Signal.Backbone.Views.Lightbox.show(this.lightboxView.el); + + window.log.info('displayTapToViewMessage: showed lightbox'); }, deleteMessage(messageId: string) {