Bug 226664

Summary: Web Inspector: Uncaught Exception: undefined is not an object (evaluating 'InspectorBackend.Enum.Page.ResourceType')
Product: WebKit Reporter: Devin Rousso <hi>
Component: Web InspectorAssignee: Devin Rousso <hi>
Status: RESOLVED FIXED    
Severity: Normal CC: bburg, hi, inspector-bugzilla-changes, joepeck, pangle, rcaliman, timothy, webkit-bug-importer, yusufalaaothman001
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
URL: blob:https://twitter.com/27274f10-3876-4d84-b731-eedfd3b3c46e
Attachments:
Description Flags
Patch
none
Patch none

Description Devin Rousso 2021-06-04 14:30:37 PDT
Uncaught Exception in Web Inspector.

Steps to Reproduce:
1. inspect the twitter.com service worker
2. reload the page

Uncaught Exceptions:
-----------------------
 - undefined is not an object (evaluating 'InspectorBackend.Enum.Page.ResourceType') (at NetworkManager.js:1064:68)
    _addNewResourceToFrameOrTarget @ NetworkManager.js:1064:68
    resourceRequestWillBeSent @ NetworkManager.js:664:55
    requestWillBeSent @ NetworkObserver.js:48:52
    _dispatchEvent @ Connection.js:210:26
    dispatch @ Connection.js:79:32
    dispatch @ InspectorBackend.js:232:52
    ? @ MessageDispatcher.js:42:34

Additional Details:
    cause --> An uncaught exception was thrown while handling event: Network.requestWillBeSent
-----------------------

Notes:
Inspected URL:        blob:https://twitter.com/27274f10-3876-4d84-b731-eedfd3b3c46e
Loading completed:    true
Frontend User Agent:  Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko)
Dispatch Source:      Protocol Event

Protocol Event:
{"method":"Network.requestWillBeSent","params":{"requestId":"0.145","frameId":"","loaderId":"","documentURL":"https://twitter.com/i/api/1.1/branch/init.json","request":{"url":"https://twitter.com/i/api/1.1/branch/init.json","method":"POST","headers":{"Accept":"*/*","Content-Type":"application/json","Authorization":"Bearer AAAAAAAAAAAAAAAAAAAAANRILgAAAAAAnNwIzUejRCOuH5E6I8xnZz4puTs%3D1Zv7ttfk8LF81IUq16cHjhLTvJu4FA33AGWWjCpTnA","x-csrf-token":"bd6f7ed739f0e02b034fe8c618f37c6f","x-twitter-active-us…
Comment 1 Devin Rousso 2021-06-04 15:25:08 PDT
Created attachment 430619 [details]
Patch
Comment 2 Joseph Pecoraro 2021-06-04 15:37:52 PDT
Comment on attachment 430619 [details]
Patch

Testable?
Comment 3 Devin Rousso 2021-06-04 15:44:17 PDT
(In reply to Joseph Pecoraro from comment #2)
> Testable?
Not really, as the tests are always either `"page"` or `"web-page"` (or don't use `InspectorBackend` at all) and therefore already had all of the domains that had enums.  We maybe could do something like checking that a WK1 test has `InspectorBackend.Enum.Target.TargetInfoType` (since that's only enabled for `"web-page"`, but that seems kinda awful :/
Comment 4 Devin Rousso 2021-06-04 15:46:54 PDT
(In reply to Devin Rousso from comment #3)
> (In reply to Joseph Pecoraro from comment #2)
> > Testable?
> 
> Not really, as the tests are always either `"page"` or `"web-page"` (or don't use `InspectorBackend` at all) and therefore already had all of the domains that had enums.  We maybe could do something like checking that a WK1 test has `InspectorBackend.Enum.Target.TargetInfoType` (since that's only enabled for `"web-page"`, but that seems kinda awful :/

Oh wait no I'm completely crazy yes we can add a test.  Just check for `InspectorBackend.Enum.ServiceWorker` (even though there are no enums in `ServiceWorker`) :)
Comment 5 Devin Rousso 2021-06-04 15:58:55 PDT
Created attachment 430627 [details]
Patch
Comment 6 EWS 2021-06-04 17:17:04 PDT
Committed r278512 (238511@main): <https://commits.webkit.org/238511@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 430627 [details].
Comment 7 Radar WebKit Bug Importer 2021-06-04 17:18:24 PDT
<rdar://problem/78892937>