RESOLVED FIXED 144681
Web Inspector: Activity Viewer does not update on "clear all console messages"
https://bugs.webkit.org/show_bug.cgi?id=144681
Summary Web Inspector: Activity Viewer does not update on "clear all console messages"
Tobias Reiss
Reported 2015-05-06 04:59:12 PDT
* SUMMARY Clearing all console messages does not affect the Activity Viewer. * STEPS TO REPRODUCE 1. Go to Console Tab 2. Type: console.error("error"); 3. Activity Viewer shows one error 4. Clear log 5. Activity Viewer still shows one error
Attachments
patch (2.39 KB, patch)
2015-05-29 14:45 PDT, Tobias Reiss
no flags
patch (2.45 KB, patch)
2015-05-29 15:08 PDT, Tobias Reiss
no flags
Radar WebKit Bug Importer
Comment 1 2015-05-06 04:59:29 PDT
Nikita Vasilyev
Comment 2 2015-05-07 03:34:23 PDT
I was able to reproduce this bug by pressing the trash icon on the right top corner of the console. Clearing the console by Control L works as expected.
Tobias Reiss
Comment 3 2015-05-08 11:08:54 PDT
Tobias Reiss
Comment 4 2015-05-08 16:07:22 PDT
LogManager listens on "Console.messagesCleared" events from Backend. A typical stack of events looks like this on a page reload: - load page that contains a console.log("test") - "WebInspector.ConsoleObserver.messageAdded" // from Backend, prints "test" - reload page - "WebInspector.ConsoleObserver.messagesCleared" // from Backend - "WebInspector.Frame.Event.MainResourceDidChange" // from ?, indicates "session start" - "WebInspector.ConsoleObserver.messageAdded" // from Backend, prints "test" - "WebInspector.ConsoleObserver.messagesCleared" // from Backend, why?? Conclusion The former "messagesCleared" can be instrumented to clear on reload or not. The latter "messagesCleared" breaks our logic and should be avoided.
Tobias Reiss
Comment 5 2015-05-26 16:51:53 PDT
APIs that let you clear the Console: - clear() and console.clear() are handled by Backend only [1]. WORKS - Button and Context Menu are handled Frontend only [2] & [3]. DOES NOT WORK - Clear/Keep on reload are handled by both. [1] & [4]. DOES NOT WORK - Shortcuts are handled by both [5] & [1]. WORKS WORKS means that the Console was cleared and Activity Viewer was updated correctly DOES NOT WORK means that the Activity Viewer wasn't updated correctly. I don't see a clear pattern here. Either the Backend should call "messagesCleared" more often and Frontend should get ride of some duplicated event handlers or the other way round. Right now the strategy looks inconsistent and order of event handlers is important. [1] https://github.com/WebKit/webkit/blob/91ba8734ceadd8fd3b73942008358ef8a4a81715/Source/JavaScriptCore/inspector/agents/InspectorConsoleAgent.cpp#L107 [2] https://github.com/WebKit/webkit/blob/f647f216a7e9a781ba96bc823787fdf667f868ea/Source/WebInspectorUI/UserInterface/Views/LogContentView.js#L72 [3] https://github.com/WebKit/webkit/blob/f647f216a7e9a781ba96bc823787fdf667f868ea/Source/WebInspectorUI/UserInterface/Views/LogContentView.js#L344 [4] https://github.com/WebKit/webkit/blob/f647f216a7e9a781ba96bc823787fdf667f868ea/Source/WebInspectorUI/UserInterface/Views/LogContentView.js#L306 [5] https://github.com/WebKit/webkit/blob/846f78432c3b5b041177716350dc1335c8d45097/Source/WebInspectorUI/UserInterface/Controllers/JavaScriptLogViewController.js#L52-L53
Tobias Reiss
Comment 6 2015-05-29 14:45:56 PDT
Joseph Pecoraro
Comment 7 2015-05-29 14:57:49 PDT
Comment on attachment 253917 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=253917&action=review r=me! One step forward, good catch. > Source/WebInspectorUI/UserInterface/Views/LogContentView.js:634 > + // FIXME: https://bugs.webkit.org/show_bug.cgi?id=145466 I prefer writing bug links with their title. So: // FIXME: <https://webkit.org/b/145466> Web Inspector: Activity Viewer does not update on "Clear Log on reload"
Tobias Reiss
Comment 8 2015-05-29 15:08:53 PDT
Joseph Pecoraro
Comment 9 2015-05-29 15:17:05 PDT
Comment on attachment 253922 [details] patch r=me
WebKit Commit Bot
Comment 10 2015-05-29 16:08:02 PDT
Comment on attachment 253922 [details] patch Clearing flags on attachment: 253922 Committed r185015: <http://trac.webkit.org/changeset/185015>
WebKit Commit Bot
Comment 11 2015-05-29 16:08:11 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.