Status

For bugs in Firefox DevTools, the developer tools within the Firefox web browser. This includes issues about the user interface of the toolbox, special pages such as about:debugging and about:devtools, and developer-related APIs.

Hi there.
I investigated a little an I think this patch resolve the issue.
In https://dxr.mozilla.org/mozilla-central/source/devtools/client/webconsole/webconsole.js#2183 , the _outputMessageFromQueue function tells if a message should be repeated by calling the _filterRepeatedMessage function
> let isRepeated = this._filterRepeatedMessage(node);
So I took a look at filterRepeatedMessage :
> let uid = repeatNode._uid;
> let dupeNode = null;
> [...]
> let lastRepeatNode = lastMessage.getElementsByClassName("message-repeats")[0];
> if (lastRepeatNode && lastRepeatNode._uid == uid) {
> dupeNode = lastMessage;
> }
A message should be repeated if it has the same _uid attribute than the last message.
The _uid attribute is declared in https://dxr.mozilla.org/mozilla-central/source/devtools/client/webconsole/console-output.js , in _renderRepeatNode , which only JSON.stringify this.repeatID .
If we look at the Messages.Extended constructor, we can see this line :
> this._repeatID.messagePieces = this._repeatID.messagePieces = messagePieces + "";
In the case of falsy values, messagePieces is an object
> {
> type: undefined|null|NaN
> }
And thus the messagePieces + "" returns "[Object object]", whether the type is null, undefined or NaN.
And that's what causes the message to be repeated.
So, instead of concatenating, if we stringify messagePieces, we don't have the repeated values anymore
> - this._repeatID.messagePieces = messagePieces + "";
> + this._repeatID.messagePieces = JSON.stringify(messagePieces);
As you suggested, I added some tests to https://dxr.mozilla.org/mozilla-central/source/devtools/client/webconsole/test/browser_repeated_messages_accuracy.js in order to test this bug.
Then i ran :
> /mach test devtools/client/webconsole/*
And everything passed ( except one TODO ).
Let me know if something is wrong, or if I can push this patch to TRY.
Thank you

(In reply to Nicolas Chevobbe from comment #6)
> Thanks for pushing this to TRY.
> The job is now over and there are a few failures in Linux Debug and Windows
> Debug but I don't really know if it is due to my patch.
None of those failures look related, so it's looking good. I'll review the patch today