RESOLVED FIXED Bug 170609
Web Inspector: WebSockets: Transferred size is incorrect
https://bugs.webkit.org/show_bug.cgi?id=170609
Summary Web Inspector: WebSockets: Transferred size is incorrect
Nikita Vasilyev
Reported 2017-04-07 11:49:50 PDT
Transferred size for WebSocket messages is currently incorrect. https://github.com/WebKit/webkit/blob/add8695eff1c434696a6db324fa5daca1bfd4813/Source/WebInspectorUI/UserInterface/Models/WebSocketResource.js#L75 this.increaseSize(data.length, elapsedTime); data is a string. data.length does not represent it's size. I think we should send payload size from the backend. We currently don't do this. In WebSocket protocol, payload length must be included with each message: https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API/Writing_WebSocket_servers#Format
Attachments
Patch (7.02 KB, patch)
2017-04-07 18:36 PDT, Nikita Vasilyev
mattbaker: review-
Nikita Vasilyev
Comment 1 2017-04-07 13:38:49 PDT
If for some reason the backend change isn't feasible, we should replace data.length with new TextEncoder("utf-8").encode(data).length
Nikita Vasilyev
Comment 2 2017-04-07 18:36:39 PDT
Radar WebKit Bug Importer
Comment 3 2017-04-10 16:05:33 PDT
Nikita Vasilyev
Comment 4 2017-04-10 16:17:36 PDT
Comment on attachment 306560 [details] Patch This patch doesn't have any tests. I'll combine it with Bug 169175 - Web Inspector: Add tests for webSocketFrameSent and webSocketFrameReceived.
Matt Baker
Comment 5 2017-04-12 22:16:11 PDT
Comment on attachment 306560 [details] Patch Looks good! r- for now, because we should include a test for the protocol change.
Matt Baker
Comment 6 2017-04-12 22:17:48 PDT
(In reply to Nikita Vasilyev from comment #4) > Comment on attachment 306560 [details] > Patch > > This patch doesn't have any tests. I'll combine it with Bug 169175 - Web > Inspector: Add tests for webSocketFrameSent and webSocketFrameReceived. Since it's a protocol change I think a test should be included in this patch.
Nikita Vasilyev
Comment 7 2017-04-14 23:55:52 PDT
Note You need to log in before you can comment on or make changes to this bug.