Closed Bug 1688590 Opened 3 years ago Closed 3 years ago

WebSocket payload preview broken

Categories

(DevTools :: Netmonitor, defect, P2)

defect

Tracking

(firefox86 fixed, firefox87 fixed)

RESOLVED FIXED
87 Branch
Tracking Status
firefox86 --- fixed
firefox87 --- fixed

People

(Reporter: Honza, Assigned: bomsy)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

I am not seeing preview for WS JSON payload that contains "data" field.

STR:

  1. Load http://janodvarko.cz/test/websockets/
  2. Open the Network panel
  3. Click "Connect" button on the page
  4. Try to send some messages (just to have something in the list of frames to select)
  5. Select the 101 HTTP request and select the Response panel
  6. Put the following string into the Send input field and click the "Send" button
    { "data": { } }
  7. Select the WS frame in the Response panel -> the payload preview section is not updated BUG

ER:
The payload preview section should be properly updated when the use selects a frame in the list.

Honza

Severity: -- → S3
Has STR: --- → yes
Priority: -- → P3

Thanks Honza!
I can reproduce it. I get this error TypeError: payloadUnclean.match is not a function. It might relate to this https://phabricator.services.mozilla.com/D80720

Priority: P3 → P2
Assignee: nobody → hmanilla

The fix should be uplifted to beta when properly tested in Nightly.

Honza

After more investigation, we hit the issue mentioned in this comment

https://bugzilla.mozilla.org/show_bug.cgi?id=1590046#c18

We have a loose rule in determining if the json payload is an Action Cable or not. https://searchfox.org/mozilla-central/rev/69babd862de70cabfa1d0a369d38e4881bd41e4d/devtools/client/netmonitor/src/components/messages/MessagePayload.js#291-293

The fix was a bit tricky so i guess a compromise was made here

https://bugzilla.mozilla.org/show_bug.cgi?id=1590046#c21

Identifying json Action cable payloads is tricky. Currently we parse the json again in parseActionCable to determine if
it is an Action cable payload.

Instead lets check using a possible criteria before attempting to call parseActionCable.
See https://medium.com/codequest/actioncable-in-rails-api-f087b65c860d for Action cable details.

Pushed by hmanilla@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/dfe7c77efb78
Use more specific rules to determine 'action cable' payloads r=Honza
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 87 Branch

Comment on attachment 9199348 [details]
Bug 1688590 - Use more specific rules to determine 'action cable' payloads r=honza

Beta/Release Uplift Approval Request

  • User impact if declined: Impacts only developers
  • Is this code covered by automated tests?: Yes
  • Has the fix been verified in Nightly?: Yes
  • Needs manual test from QE?: No
  • If yes, steps to reproduce:
  • List of other uplifts needed: None
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): Small JavaScript change, with tests included
  • String changes made/needed:
Attachment #9199348 - Flags: approval-mozilla-beta?

Comment on attachment 9199348 [details]
Bug 1688590 - Use more specific rules to determine 'action cable' payloads r=honza

Low risk, has tests, approved for 86 beta 6, thanks.

Attachment #9199348 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: