Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: ee7a441e1017219ba935cc967cf7dc0734d93526
https://github.com/WebKit/WebKit/commit/ee7a441e1017219ba935cc967cf7dc0734d93526
Author: Ahmad Saleem <[email protected]>
Date: 2026-07-14 (Tue, 14 Jul 2026)
Changed paths:
A
LayoutTests/inspector/model/remote-object-get-collection-entries-error-expected.txt
A
LayoutTests/inspector/model/remote-object-get-collection-entries-error.html
M Source/WebInspectorUI/UserInterface/Protocol/RemoteObject.js
M Source/WebInspectorUI/UserInterface/Views/FormattedValue.js
M Source/WebInspectorUI/UserInterface/Views/ObjectPreviewView.js
Log Message:
-----------
Web Inspector: RemoteObject.getCollectionEntries crashes on protocol error
instead of reporting it
https://bugs.webkit.org/show_bug.cgi?id=319333
rdar://182148993
Reviewed by Devin Rousso.
WI.RemoteObject.prototype.getCollectionEntries ignored the `error`
argument in its RuntimeAgent.getCollectionEntries reply handler and
unconditionally called `entries.map(...)`. When the backend returns an
error (e.g. the collection's object was released or the target
navigated, so its objectId is stale), `entries` is undefined and the
handler throws "TypeError: undefined is not an object", which is
swallowed by the backend dispatcher and leaves the callback never
invoked.
That crash also masks the intended error path: both ObjectTreeView and
ObjectTreePropertyTreeElement wrap the callback with an `if (!list)`
check that shows "Could not fetch properties. Object may no longer
exist.", but the exception fires before that handler ever runs.
Guard on `error` and pass null to the callback, matching the existing
_getPropertyDescriptorsResolver pattern and the callers' `!list` error
handling. Null (rather than an empty array) is required so the tree
views surface the error instead of silently rendering "No Entries".
Since the callback can now receive null, also harden the collection
entry node-preview path, which previously assumed a non-null array:
ObjectPreviewView's remoteObjectAccessor dereferenced `entries[0]`
unconditionally, and FormattedValue's node-highlight consumer called
pushNodeToFrontend() on the resulting remote object. Both now bail out
on a null result instead of throwing.
Without fix, we timeout on the attached test case.
Test: inspector/model/remote-object-get-collection-entries-error.html
*
LayoutTests/inspector/model/remote-object-get-collection-entries-error-expected.txt:
Added.
* LayoutTests/inspector/model/remote-object-get-collection-entries-error.html:
Added.
* Source/WebInspectorUI/UserInterface/Protocol/RemoteObject.js:
(WI.RemoteObject.prototype.getCollectionEntries):
* Source/WebInspectorUI/UserInterface/Views/ObjectPreviewView.js:
(WI.ObjectPreviewView.prototype._appendCollectionEntryNodePreview):
* Source/WebInspectorUI/UserInterface/Views/FormattedValue.js:
(WI.FormattedValue.createElementForNodePreview):
Canonical link: https://commits.webkit.org/317191@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications