Closed
Bug 1089577
Opened 10 years ago
Closed 9 years ago
Debug logs should include displayed message
Categories
(Chat Core :: Security: OTR, defect)
Chat Core
Security: OTR
Tracking
(Not tracked)
RESOLVED
FIXED
1.6
People
(Reporter: aleth, Assigned: arlolra)
References
Details
Attachments
(1 file, 2 obsolete files)
4.31 KB,
patch
|
aleth
:
review+
|
Details | Diff | Splinter Review |
Especially when incoming messages are encrypted, debug logs are hard to read unless they also include the displayed version of messages. It may be necessary to use a separate this.DEBUG call for this, but that doesn't matter as long as it's clear which already logged (encrypted) message that refers to. You can add a pref if you'd like to turn this off by default for Tor.
Attachment #8571673 -
Flags: review?(florian)
Attachment #8571673 -
Flags: review?(clokep)
Attachment #8571673 -
Flags: review?(aleth)
Updated•9 years ago
|
Attachment #8571673 -
Flags: review?(clokep)
Reporter | ||
Comment 2•9 years ago
|
||
Comment on attachment 8571673 [details] [diff] [review] debug.patch Review of attachment 8571673 [details] [diff] [review]: ----------------------------------------------------------------- Just checking you've tested this works as expected with OTR installed? ::: chat/components/src/imConversations.js @@ +441,5 @@ > // UIConversation. This happens when this.systemMessage() is called. The > // conversation for the message is set as the UIConversation. > + prepareForDisplaying: function(aMsg) { > + if (aMsg.displayMessage !== aMsg.message) > + this.DEBUG("Displaying:\n" + aMsg.displayMessage + "\nFor:\n" + aMsg.message); I'm not sure this one makes sense as is: - is this.DEBUG even defined here? - messages added by the UI don't appear in prpl debug logs anyway, do they? - under what circumstances would a message passing through here have displayMessage != message? ::: chat/modules/jsProtoHelper.jsm @@ +484,5 @@ > prepareForSending: function(aOutgoingMessage, aCount) null, > + prepareForDisplaying: function(aImMessage) { > + if (aImMessage.displayMessage !== aImMessage.message) > + this.DEBUG("Displaying:\n" + aImMessage.displayMessage + "\nFor:\n" + > + aImMessage.message); If it's ensured this appears in the debug log directly after the incoming message, you likely don't need to include the 'raw' message a second time, and can simply say "Displayed as:". Or is there something async about this? ::: chat/protocols/irc/irc.js @@ +132,5 @@ > this._account.countBytes(baseMessage); > }, > // Apply CTCP formatting before displaying. > prepareForDisplaying: function(aMsg) { > aMsg.displayMessage = ctcpFormatToHTML(aMsg.displayMessage); Ask clokep whether we care about logging if displayMessage != message solely due to this ctcp call. @@ +134,5 @@ > // Apply CTCP formatting before displaying. > prepareForDisplaying: function(aMsg) { > aMsg.displayMessage = ctcpFormatToHTML(aMsg.displayMessage); > + if (aMsg.displayMessage !== aMsg.message) > + this.DEBUG("Displaying:\n" + aMsg.displayMessage + "\nFor:\n" + aMsg.message); Instead of duplicating this code, call the prepareForDisplaying from jsProtoHelper.
Attachment #8571673 -
Flags: review?(aleth) → review-
Comment on attachment 8571673 [details] [diff] [review] debug.patch Review of attachment 8571673 [details] [diff] [review]: ----------------------------------------------------------------- > Just checking you've tested this works as expected with OTR installed? Yes, I have on IRC with OTR enabled. Thanks for the quick review. ::: chat/components/src/imConversations.js @@ +441,5 @@ > // UIConversation. This happens when this.systemMessage() is called. The > // conversation for the message is set as the UIConversation. > + prepareForDisplaying: function(aMsg) { > + if (aMsg.displayMessage !== aMsg.message) > + this.DEBUG("Displaying:\n" + aMsg.displayMessage + "\nFor:\n" + aMsg.message); Good point. Part of the reason I duplicated this code in all the prpls was because DEBUG wasn't available in the uiConv and going through uiConv.account.logDebugMessage was cumbersome. Silly that I then went and did this. Anyways, yes, removing. ::: chat/modules/jsProtoHelper.jsm @@ +484,5 @@ > prepareForSending: function(aOutgoingMessage, aCount) null, > + prepareForDisplaying: function(aImMessage) { > + if (aImMessage.displayMessage !== aImMessage.message) > + this.DEBUG("Displaying:\n" + aImMessage.displayMessage + "\nFor:\n" + > + aImMessage.message); The incoming path is probably sync. But outgoing isn't ... ::: chat/protocols/irc/irc.js @@ +132,5 @@ > this._account.countBytes(baseMessage); > }, > // Apply CTCP formatting before displaying. > prepareForDisplaying: function(aMsg) { > aMsg.displayMessage = ctcpFormatToHTML(aMsg.displayMessage); I suspect we don't. @@ +134,5 @@ > // Apply CTCP formatting before displaying. > prepareForDisplaying: function(aMsg) { > aMsg.displayMessage = ctcpFormatToHTML(aMsg.displayMessage); > + if (aMsg.displayMessage !== aMsg.message) > + this.DEBUG("Displaying:\n" + aMsg.displayMessage + "\nFor:\n" + aMsg.message); Ok.
Attachment #8571673 -
Flags: review?(florian)
Attachment #8571673 -
Attachment is obsolete: true
Attachment #8572112 -
Flags: review?(aleth)
Reporter | ||
Comment 5•9 years ago
|
||
Comment on attachment 8572112 [details] [diff] [review] debug.patch from comment 3 Review of attachment 8572112 [details] [diff] [review]: ----------------------------------------------------------------- Thanks!
Attachment #8572112 -
Flags: review?(aleth) → review+
Reporter | ||
Comment 6•9 years ago
|
||
https://hg.mozilla.org/comm-central/rev/fb222d0daf7c
Reporter | ||
Updated•9 years ago
|
Assignee: nobody → arlolra
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → 1.6
Comment 7•9 years ago
|
||
Please back this out until the test is fixed.
Comment 8•9 years ago
|
||
Backed out: https://hg.mozilla.org/comm-central/rev/635555c60eb2
Ugh, so embarrassing. Sorry everyone. The fake account in test_conversation.js needed a no-op DEBUG method.
Attachment #8572112 -
Attachment is obsolete: true
Attachment #8572805 -
Flags: review?(aleth)
Reporter | ||
Updated•9 years ago
|
Attachment #8572805 -
Flags: review?(aleth) → review+
Reporter | ||
Comment 10•9 years ago
|
||
https://hg.mozilla.org/comm-central/rev/dd2d7974c1ee
Reporter | ||
Comment 11•9 years ago
|
||
Please add the reviewer to the commit message next time! Thanks.
Updated•5 years ago
|
Component: General → Security: OTR
You need to log in
before you can comment on or make changes to this bug.
Description
•