Bug 142603 - Web Inspector: Console Errors during provisional document loads get lost with "Clear Log on Reload"
Summary: Web Inspector: Console Errors during provisional document loads get lost with...
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Joseph Pecoraro
Keywords: InRadar
Depends on:
Reported: 2015-03-11 17:44 PDT by Joseph Pecoraro
Modified: 2015-03-12 09:10 PDT (History)
8 users (show)

See Also:

[PATCH] Proposed Fix (4.34 KB, patch)
2015-03-11 17:50 PDT, Joseph Pecoraro
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Joseph Pecoraro 2015-03-11 17:44:46 PDT
Console Errors during provisional document loads get lost with "Clear Log on Reload".

1. Enable "Clear Log on Reload" in Web Inspector's console (context menu in Console Log View)
2. Inspect <https://docs.google.com/spreadsheets/d/1ch7X6RljdfAFjfGY926UkLrPxZTrcbIYg0bGmrJ8gHQ/edit?usp=sharing_eid> [you do not need access to the file]
3. Reload
  => error message shows in console then gets cleared


Order of events:

    -> Page.reload
      -> Page.frameWillStartLoading
      -> Network.requestWillBeSent

    -> Network.responseReceived (error)
      -> Console.messageAdded

    -> commit
      -> Console.messagesCleared
      -> Page.frameNavigated

So we receive the error during provisional loading, and auto-clear it. We should preserve these messages that relate more to the new page, not the old page.

Comment 1 Joseph Pecoraro 2015-03-11 17:50:00 PDT
Created attachment 248470 [details]
[PATCH] Proposed Fix

I tried an approach using a marker ConsoleSession in the JavaScriptLogViewController. It quickly got more complex then this, and being yet-another-Session had styling issues that I couldn't figure out. This approach is far simpler and gives expected behavior with very few drawbacks given the rare cases it would occur.
Comment 2 Timothy Hatcher 2015-03-12 08:25:46 PDT
Comment on attachment 248470 [details]
[PATCH] Proposed Fix

View in context: https://bugs.webkit.org/attachment.cgi?id=248470&action=review

> Source/WebInspectorUI/ChangeLog:11
> +        Detect a provisional load has started to start save messages that come in at this time.

Whoa. Nice fix.

> Source/WebInspectorUI/UserInterface/Views/LogContentView.js:33
> +    // FIXME: Try to use a marker, instead of a list of messages that get re-added.

Yeah, that would be good. Maybe the console rework can fix this.
Comment 3 WebKit Commit Bot 2015-03-12 09:10:31 PDT
Comment on attachment 248470 [details]
[PATCH] Proposed Fix

Clearing flags on attachment: 248470

Committed r181437: <http://trac.webkit.org/changeset/181437>
Comment 4 WebKit Commit Bot 2015-03-12 09:10:36 PDT
All reviewed patches have been landed.  Closing bug.