Handle objects in log point messages

RESOLVED FIXED in Firefox 67



5 months ago
4 months ago


(Reporter: bhackett, Assigned: bhackett)


(Blocks 1 bug)

Dependency tree / graph

Firefox Tracking Flags

(firefox67 fixed)



(3 attachments)



5 months ago
Posted patch patchSplinter Review

Logging objects is not currently supported with log points: the objects will be converted to a "<UnknownSearchObject>" string in the console UI.

The main problem with supporting this is that the mechanisms/hacks used to allow inspecting console objects after the point they were logged only works with objects that are always logged by a console.log() call in the original source. Dynamically injecting logs doesn't leave us with a good place to query information about these objects.

The attached patch replaces this mechanism with a better one. Instead of having special debugger objects that are associated with console messages and use special requests to communicate with the child, the child sends snapshots of the contents of these objects, including their normal data (class/etc.) and any properties. The server code in the middleman creates a ReplayDebuggerObjectSnapshot based on this data, which acts like a ReplayDebuggerObject and reuses its implementation but is set up to avoid needing to communicate with the child at all in order to access its contents. It can't be fully explored --- object properties are converted in the child to an "<unavailable>" string --- so has similar limitations to the old approach. It is cleaner, more flexible, and more robust (this also fixes things so that the properties dropdown on console message objects works) than the old approach, however.


Comment 1

5 months ago

Replace the special handling for console log objects with a more general object snapshot mechanism, as described above.

Attachment #9042856 - Flags: review?(lsmyth)

Comment 2

5 months ago

Currently, the server sends log point messages while replaying to the client in the form of virtualConsoleLog packets. These do not support sending objects to the client (object actor grips would be needed) so the messages are stringified first. The attached patch removes virtualConsoleLog packets and uses the normal method for sending console API calls, which will generate object grips for any logged objects.

Attachment #9042859 - Flags: review?(lsmyth)
Attachment #9042856 - Flags: review?(lsmyth) → review+
Attachment #9042859 - Flags: review?(lsmyth) → review+

Comment 3

4 months ago
Pushed by bhackett@mozilla.com:
Part 1 - Allow snapshots when sending objects to the middleman, r=lsmyth.
Part 2 - Use onConsoleAPICall when sending log point messages to the client, r=lsmyth.

Comment 4

4 months ago
Closed: 4 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla67
You need to log in before you can comment on or make changes to this bug.