Bug 204823

Summary: Web Inspector: Error: Can't make a ContentView for an unknown representedObject of type: CallFrame
Product: WebKit Reporter: Yury Semikhatsky <yurys>
Component: Web InspectorAssignee: Yury Semikhatsky <yurys>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, hi, inspector-bugzilla-changes, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch
none
test page
none
Patch
hi: review+, hi: commit-queue-
Patch for landing none

Yury Semikhatsky
Reported 2019-12-03 17:00:26 PST
resource:///org/webkit/inspector/UserInterface/Views/ContentView.js:193:132: CONSOLE ERROR Error: Can't make a ContentView for an unknown representedObject of type: CallFrame is printed to the console when navigating from a paused page.
Attachments
Patch (1.72 KB, patch)
2019-12-03 17:05 PST, Yury Semikhatsky
no flags
test page (586 bytes, text/html)
2019-12-04 11:23 PST, Yury Semikhatsky
no flags
Patch (1.88 KB, patch)
2019-12-11 14:07 PST, Yury Semikhatsky
hi: review+
hi: commit-queue-
Patch for landing (1.77 KB, patch)
2019-12-12 09:37 PST, Yury Semikhatsky
no flags
Yury Semikhatsky
Comment 1 2019-12-03 17:05:48 PST
Devin Rousso
Comment 2 2019-12-03 17:25:17 PST
Comment on attachment 384769 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=384769&action=review > Source/WebInspectorUI/UserInterface/Views/NavigationSidebarPanel.js:708 > - return true; > + return !!typeIdentifier; I don't really see a problem with this change on its own, but I want to know more about why/how this happens. I'd recommend adding a `console.trace()` in `WI.ContentView.createFromRepresentedObject` to see how this gets here. This solution may just mask an actual problem. Describing the steps to reproduce in the bug would also be appreciated :)
Yury Semikhatsky
Comment 3 2019-12-03 23:44:31 PST
Comment on attachment 384769 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=384769&action=review >> Source/WebInspectorUI/UserInterface/Views/NavigationSidebarPanel.js:708 >> + return !!typeIdentifier; > > I don't really see a problem with this change on its own, but I want to know more about why/how this happens. I'd recommend adding a `console.trace()` in `WI.ContentView.createFromRepresentedObject` to see how this gets here. This solution may just mask an actual problem. > > Describing the steps to reproduce in the bug would also be appreciated :) Well, this change was made a month ago, I don't remember exact steps off the top of my head. I can try and reproduce it tomorrow maybe it manifested itself when fix for https://bugs.webkit.org/show_bug.cgi?id=204170 is applied.
Yury Semikhatsky
Comment 4 2019-12-04 11:23:14 PST
Created attachment 384830 [details] test page ok, these are the steps to reproduce it on tip of tree: 1. Open inspector for the attached page 2. Click on 'Debugger' button 3. When execution breaks click on 'Navigate' button 4. Resume debugger Result: message in the console, frontend fails with the following trace Error:​ Can't make a ContentView for an unknown representedObject of type:​ CallFrame (at ContentView.js:​193:​132)​ createFromRepresentedObject @ ContentView.js:​193:​24 contentViewForRepresentedObject @ ContentView.js:​214:​72 showContentViewForRepresentedObject @ ContentBrowser.js:​151:​63 showDefaultContentViewForTreeElement @ NavigationSidebarPanel.js:​202:​82 _checkElementsForPendingViewStateCookie @ NavigationSidebarPanel.js:​728:​79 _checkOutlinesForPendingViewStateCookie @ NavigationSidebarPanel.js:​684:​53 finalAttemptToRestoreViewStateFromCookie @ NavigationSidebarPanel.js:​257:​57 finalAttemptToRestoreViewStateFromCookie @ [native code]​
Yury Semikhatsky
Comment 5 2019-12-04 11:23:36 PST
Comment on attachment 384769 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=384769&action=review >>> Source/WebInspectorUI/UserInterface/Views/NavigationSidebarPanel.js:708 >>> + return !!typeIdentifier; >> >> I don't really see a problem with this change on its own, but I want to know more about why/how this happens. I'd recommend adding a `console.trace()` in `WI.ContentView.createFromRepresentedObject` to see how this gets here. This solution may just mask an actual problem. >> >> Describing the steps to reproduce in the bug would also be appreciated :) > > Well, this change was made a month ago, I don't remember exact steps off the top of my head. I can try and reproduce it tomorrow maybe it manifested itself when fix for https://bugs.webkit.org/show_bug.cgi?id=204170 is applied. Added steps in #c4.
Yury Semikhatsky
Comment 6 2019-12-06 15:48:33 PST
Devin, are you good with landing this?
Devin Rousso
Comment 7 2019-12-11 10:06:29 PST
(In reply to Yury Semikhatsky from comment #4) > Created attachment 384830 [details] > test page > > ok, these are the steps to reproduce it on tip of tree: > > 1. Open inspector for the attached page > 2. Click on 'Debugger' button > 3. When execution breaks click on 'Navigate' button > 4. Resume debugger > > Result: message in the console, frontend fails with the following trace > > Error:​ Can't make a ContentView for an unknown representedObject of type:​ > CallFrame (at ContentView.js:​193:​132)​ > createFromRepresentedObject @ ContentView.js:​193:​24 > contentViewForRepresentedObject @ ContentView.js:​214:​72 > showContentViewForRepresentedObject @ ContentBrowser.js:​151:​63 > showDefaultContentViewForTreeElement @ NavigationSidebarPanel.js:​202:​82 > _checkElementsForPendingViewStateCookie @ NavigationSidebarPanel.js:​728:​79 > _checkOutlinesForPendingViewStateCookie @ NavigationSidebarPanel.js:​684:​53 > finalAttemptToRestoreViewStateFromCookie @ NavigationSidebarPanel.js:​257:​57 > finalAttemptToRestoreViewStateFromCookie @ [native code]​ These steps don't reproduce for me. From what I can tell, it looks like the issue is that we're attempting to save/restore a `WI.CallFrame` as the currently selected `representedObject` likely in the `WI.SourcesNavigationSidebarPanel`. Whenever a navigation occurs, we're supposed to automatically resume, so I'm not really sure why/how this is happening. As far as this change, what if instead the check was added to the `if` right before? ``` if (!typeIdentifier || typeIdentifier !== representedObject.constructor.TypeIdentifier) ``` What happens with this patch applied? What is the difference in the UI? Does it end up calling through to `showDefaultContentView` because nothing matches the cookie, or does it do something else?
Yury Semikhatsky
Comment 8 2019-12-11 14:07:17 PST
(In reply to Devin Rousso from comment #7) > (In reply to Yury Semikhatsky from comment #4) > > Created attachment 384830 [details] > > > > Error:​ Can't make a ContentView for an unknown representedObject of type:​ > > CallFrame (at ContentView.js:​193:​132)​ > > createFromRepresentedObject @ ContentView.js:​193:​24 > > contentViewForRepresentedObject @ ContentView.js:​214:​72 > > showContentViewForRepresentedObject @ ContentBrowser.js:​151:​63 > > showDefaultContentViewForTreeElement @ NavigationSidebarPanel.js:​202:​82 > > _checkElementsForPendingViewStateCookie @ NavigationSidebarPanel.js:​728:​79 > > _checkOutlinesForPendingViewStateCookie @ NavigationSidebarPanel.js:​684:​53 > > finalAttemptToRestoreViewStateFromCookie @ NavigationSidebarPanel.js:​257:​57 > > finalAttemptToRestoreViewStateFromCookie @ [native code]​ > These steps don't reproduce for me. > Are you trying to reproduce it on GTK Release build? Maybe there is some difference with other platforms as it's 100% reproducible in that configuration for me. > From what I can tell, it looks like the issue is that we're attempting to > save/restore a `WI.CallFrame` as the currently selected `representedObject` > likely in the `WI.SourcesNavigationSidebarPanel`. Whenever a navigation > occurs, we're supposed to automatically resume, so I'm not really sure > why/how this is happening. > The cookie is empty so I don't think we actually 'save' anything there. It's done as last resort as far as I can tell from this comment: // If the specific tree element wasn't found, we may need to wait for the resources // to be registered. We try one last time (match type only) after an arbitrary amount of timeout. this._finalAttemptToRestoreViewStateTimeout = setTimeout(finalAttemptToRestoreViewStateFromCookie.bind(this), relaxedMatchDelay); and the CallFrame just ends up being current represented object. > As far as this change, what if instead the check was added to the `if` right > before? > ``` > if (!typeIdentifier || typeIdentifier !== > representedObject.constructor.TypeIdentifier) > ``` > > What happens with this patch applied? What is the difference in the UI? > Does it end up calling through to `showDefaultContentView` because nothing > matches the cookie, or does it do something else? I don't see any obvious failures which I think is expected as !typeIdentifier should be equivalent to an empty cookie. If you feel confident about fixing it that way, I can do that. See the new patch.
Yury Semikhatsky
Comment 9 2019-12-11 14:07:32 PST
Devin Rousso
Comment 10 2019-12-11 17:05:02 PST
Comment on attachment 385436 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=385436&action=review r=me, I'd still like to how how the GTK and Mac ports differ such that this can happen, but I don't really see any harm in this fix as is, so I think it's fine (with one change, and I apologize in advance) > Source/WebInspectorUI/UserInterface/Views/NavigationSidebarPanel.js:704 > + if (!typeIdentifier || typeIdentifier !== representedObject.constructor.TypeIdentifier) I feel bad for saying this, but I think what you had before was actually correct. We don't want to return if the cookie doesn't have a `WI.TypeIdentifierCookieKey` value, as many cookies don't have one. It's possible for the navigation sidebar to make it's own cookie that doesn't have anything to do with a `representedObject` type, and as such, this code as is would cause that to fail. I apologize for making you go back and forth. ``` if (matchTypeOnly) return !!typeIdentifier; ```
WebKit Commit Bot
Comment 11 2019-12-12 08:57:25 PST
Comment on attachment 384769 [details] Patch Rejecting attachment 384769 [details] from commit-queue. Failed to run "['/Volumes/Data/EWS/WebKit/Tools/Scripts/webkit-patch', '--status-host=webkit-queues.webkit.org', '--bot-id=webkit-cq-01', 'validate-changelog', '--check-oops', '--non-interactive', 384769, '--port=mac']" exit_code: 1 cwd: /Volumes/Data/EWS/WebKit ChangeLog entry in Source/WebInspectorUI/ChangeLog contains OOPS!. Full output: https://webkit-queues.webkit.org/results/13290561
Yury Semikhatsky
Comment 12 2019-12-12 09:37:01 PST
Created attachment 385503 [details] Patch for landing
WebKit Commit Bot
Comment 13 2019-12-12 10:33:59 PST
Comment on attachment 385503 [details] Patch for landing Clearing flags on attachment: 385503 Committed r253437: <https://trac.webkit.org/changeset/253437>
WebKit Commit Bot
Comment 14 2019-12-12 10:34:00 PST
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 15 2019-12-12 10:34:25 PST
Note You need to log in before you can comment on or make changes to this bug.