Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Web Inspector: Console: repeated logs sometimes have the wrong timestamp
https://bugs.webkit.org/show_bug.cgi?id=255502

Reviewed by Patrick Angle.

We should only update the `timestamp` if the a repated log is not interrupted (i.e. some other message shows up in between, e.g. an evaulation).

* Source/WebInspectorUI/UserInterface/Controllers/JavaScriptLogViewController.js:
(WI.JavaScriptLogViewController.prototype.updatePreviousMessageRepeatCount):

Canonical link: https://commits.webkit.org/263265@main
  • Loading branch information
dcrousso committed Apr 21, 2023
1 parent 0420e99 commit 87eec7c
Showing 1 changed file with 2 additions and 1 deletion.
Expand Up @@ -161,17 +161,18 @@ WI.JavaScriptLogViewController = class JavaScriptLogViewController extends WI.Ob

var previousIgnoredCount = this._previousMessageView[WI.JavaScriptLogViewController.IgnoredRepeatCount] || 0;
var previousVisibleCount = this._previousMessageView.repeatCount;
this._previousMessageView.timestamp = timestamp;

if (!this._repeatCountWasInterrupted) {
this._previousMessageView.repeatCount = count - previousIgnoredCount;
this._previousMessageView.timestamp = timestamp;
return true;
}

var consoleMessage = this._previousMessageView.message;
var duplicatedConsoleMessageView = new WI.ConsoleMessageView(consoleMessage);
duplicatedConsoleMessageView[WI.JavaScriptLogViewController.IgnoredRepeatCount] = previousIgnoredCount + previousVisibleCount;
duplicatedConsoleMessageView.repeatCount = 1;
duplicatedConsoleMessageView.timestamp = timestamp;
this._appendConsoleMessageView(duplicatedConsoleMessageView);

return true;
Expand Down

0 comments on commit 87eec7c

Please sign in to comment.