Closed Bug 1606612 Opened 6 years ago Closed 6 years ago

Pretty-print WebSocket packets when verbose logging is turned on

Categories

(Remote Protocol :: Agent, enhancement, P1)

enhancement

Tracking

(firefox74 fixed)

RESOLVED FIXED
Firefox 74
Tracking Status
firefox74 --- fixed

People

(Reporter: ato, Assigned: ato)

References

(Blocks 1 open bug)

Details

(Whiteboard: [puppeteer-beta-mvp])

Attachments

(2 files, 2 obsolete files)

When remote.log.level is Log.Level.Info or above, verbose logging is enabled and we pretty-print JSON payloads to the HTTPD. We should do the same for the JSON payloads that are transmitted across the WebSocket connections.

Assignee: nobody → ato
Blocks: 1591161
Priority: -- → P1
Whiteboard: [puppeteer-alpha-reserve]

Moving the JSON payload sanitisation function to Protocol.jsm
means we can share it across modules.

The patch also adds new tests.

When remote.log.level is Log.Level.Info or above, verbose logging
is enabled and we pretty-print JSON payloads in requests to the
HTTPD in JSONHandler.

This patch matches the behaviour with JSON payloads being transmitted
across WebSocket connections.

Whiteboard: [puppeteer-alpha-reserve] → [puppeteer-beta-reserve]
Pushed by atolfsen@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/4368466b495b remote: move payload sanitization to Protocol r=remote-protocol-reviewers,whimboo https://hg.mozilla.org/integration/autoland/rev/d0ff02a17ad9 remote: pretty-print WebSocket JSON payloads when verbose logging r=remote-protocol-reviewers,whimboo
Status: NEW → ASSIGNED
Whiteboard: [puppeteer-beta-reserve] → [puppeteer-beta-mvp]

Certain CDP domains, such as IO.read, rely on returning empty strings.
This removes the filtering of empty strings from JSON payloads so
that return types from the protocol are consistent.

Filtering out empty strings in JSON payloads was not a great idea. Removing that should fix the failing tests.

Flags: needinfo?(ato)
Attachment #9118495 - Attachment is obsolete: true
Attachment #9118313 - Attachment is obsolete: true

The CDP protocol expects consistent types to be returned. By filtering
out null values and strings of zero length we break this promise.

(In reply to Andreas Tolfsen ❲:ato❳ from comment #6)

Filtering out empty strings in JSON payloads was not a great idea. Removing that should fix the failing tests.

I’ve reworked the changeset so that we drop this behaviour from JSONHandler also for consistency.

Pushed by atolfsen@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/d00e6b043f0a remote: stop sanitizing JSON payloads from the HTTPD r=remote-protocol-reviewers,whimboo https://hg.mozilla.org/integration/autoland/rev/6b0f8701cfc5 remote: pretty-print WebSocket JSON payloads when verbose logging r=remote-protocol-reviewers,whimboo
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 74
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: