Bug 204532 - Web Inspector: Console: the saved result value is still shown after page reload
Summary: Web Inspector: Console: the saved result value is still shown after page reload
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Devin Rousso
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-11-22 12:58 PST by Devin Rousso
Modified: 2019-12-02 11:23 PST (History)
5 users (show)

See Also:


Attachments
Patch (3.97 KB, patch)
2019-11-22 13:00 PST, Devin Rousso
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Devin Rousso 2019-11-22 12:58:47 PST
# STEPS TO REPRODUCE:
1. inspect any page
2. go to the Console Tab
3. enable Preserve Log
4. evaluate `{a: 1, b: 2, c: 3, d: 4, e: 5, f: 6, g: 7}`
 => notice the " == $1" next to it
5. reload the page
 => the " == $1" stays visible
6. repeat step 4
 => two " == $1" are shown
Comment 1 Devin Rousso 2019-11-22 13:00:27 PST
Created attachment 384188 [details]
Patch
Comment 2 Brian Burg 2019-11-22 14:42:23 PST
Comment on attachment 384188 [details]
Patch

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

> Source/WebInspectorUI/UserInterface/Views/ConsoleMessageView.js:248
> +        for (let node of this._messageBodyElement.querySelectorAll(".console-saved-variable"))

This seems fragile. Can we re-render() the messages in ConsoleMessageView and not draw the saved result index element if the message is older than the epoch (uh, probably since last page reload)?
Comment 3 Devin Rousso 2019-11-22 15:01:42 PST
Comment on attachment 384188 [details]
Patch

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

>> Source/WebInspectorUI/UserInterface/Views/ConsoleMessageView.js:248
>> +        for (let node of this._messageBodyElement.querySelectorAll(".console-saved-variable"))
> 
> This seems fragile. Can we re-render() the messages in ConsoleMessageView and not draw the saved result index element if the message is older than the epoch (uh, probably since last page reload)?

Fragile in what way?  We don't ever save the `.console-saved-variable` element to a member variable, so it's basically "dropped" into the DOM with no expectations about it afterwards.

Re-rendering all of the messages would likely have pretty awful performance, especially if there are a lot of messages from previous sessions.
Comment 4 Brian Burg 2019-12-02 10:38:15 PST
Comment on attachment 384188 [details]
Patch

r=me

I don't think it's worth making this any more complicated at this point.
Comment 5 WebKit Commit Bot 2019-12-02 11:22:29 PST
Comment on attachment 384188 [details]
Patch

Clearing flags on attachment: 384188

Committed r253000: <https://trac.webkit.org/changeset/253000>
Comment 6 WebKit Commit Bot 2019-12-02 11:22:30 PST
All reviewed patches have been landed.  Closing bug.
Comment 7 Radar WebKit Bug Importer 2019-12-02 11:23:20 PST
<rdar://problem/57564556>