Early WebSocket messages can be missing in the Network tab
Categories
(DevTools :: Netmonitor, defect, P3)
Tracking
(relnote-firefox 158+, firefox158 fixed)
People
(Reporter: holyfoek, Assigned: jstasiak)
References
(Blocks 1 open bug)
Details
(Keywords: dev-doc-needed)
Attachments
(5 files, 2 external files)
Reproduction instructions
Keep this running in a terminal
docker run --rm --init -p 3030:3030 ekzhang/rustpad@sha256:728dd31070c027a5978008ac816164e2052462f9ad24c295e9d645ee2dc44134
Then visit
http://localhost:3030
Go to the devtools and activate the "Network" tab, filter for WebSocket requests, then refresh the page to see the requests.
Activate the WebSocket request and open the "Response" tab.
What happened?
Often (on my machine >50%), the first message is missing from the list.
What should have happened?
The first message should start with
{"Identity":
Anything else we should know?
Tested on 91.0a1 (2021-07-06) (64-bit) with a clean profile.
I believe the reason I could not reproduce this with the public instance of the server at https://rustpad.io is that the message has to arrive immediately after the connection is open for the message to be dropped.
Updated•5 years ago
|
Comment 3•5 years ago
|
||
Thanks for the report, taso!
I can reproduce the problem using your Docker image on my Ubuntu (VM) machine.
See the attached screenshot. The first "identity" frame is missing.
Honza
Comment 4•5 years ago
•
|
||
I am also attaching simpler test case that can be also used to repro the problem.
-
Run the PHP script (WS server) locally on your machine
php -q websockets.php -
Open DevTools and select the Network panel
-
Load http://janodvarko.cz/tests/bugzilla/1719394/
You can also load data URL:data:text/html,<script>new WebSocket('ws://127.0.0.1:12345/websockets.php');</script> -
Inspect WS frames for the 101 request
ER: You should see two frames: First Now <time> and (after two seconds) Second Now <time>
AR: The First Now frame is missing sometimes
You can also run the HTML client file locally on your machine (might be easier to repro the issue)
Honza
Comment 5•5 years ago
|
||
Updated•5 years ago
|
This bug makes debugging web socket connections in firefox unreliable, is there any workaround maybe?
| Assignee | ||
Comment 7•2 months ago
|
||
Frames can be delivered before webSocketOpened reaches the DevTools
watcher. Carry the HTTP channel ID on every frame callback so those
frames can be associated immediately instead of being discarded.
Updated•2 months ago
|
| Assignee | ||
Comment 8•2 months ago
|
||
I have a patch (Phabricator revision attached) that I've been running for a few days and it seems to be working fine.
| Assignee | ||
Comment 9•2 months ago
|
||
D320711 makes the HTTP channel ID available without consulting the
WebSocket connection map for frame notifications. Carry the ID on close
notifications as well so the DevTools watcher can remove that map.
Depends on D320711.
Comment 10•1 month ago
|
||
Comment 11•1 month ago
|
||
Comment 12•1 month ago
|
||
Backed out for causing dt failures @browser_net_ws-early-connection.js.
Comment 13•1 month ago
|
||
Comment 14•1 month ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/0ba5a6dc2240
https://hg.mozilla.org/mozilla-central/rev/53e05637fde1
Comment 15•1 month ago
|
||
Was backed out, should not be closed I think?
Updated•1 month ago
|
Comment 16•1 month ago
|
||
Comment 17•1 month ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/4be950c89eb3
https://hg.mozilla.org/mozilla-central/rev/8262f7bdd206
Comment 18•1 month ago
|
||
Thanks for fixing this bug Jakub, glad it made it to mozilla-central this time!
| Assignee | ||
Comment 19•1 month ago
|
||
Thank you for your help, it's much appreciated.
Comment 20•1 month ago
|
||
:jstasiak did you want to nominate this for 158 release notes?
| Assignee | ||
Comment 21•1 month ago
|
||
Sure, let me know if this looks fine:
Release Note Request (optional, but appreciated)
[Why is this notable]: The Network Monitor could miss initial WebSocket messages if they arrived immediately after a connection was established.
[Affects Firefox for Android]: No
[Suggested wording]: Fixed an issue where the Network Monitor could miss WebSocket messages if they arrived immediately after a connection was established.
[Links (documentation, blog post, etc)]: N/A
Updated•1 month ago
|
Updated•1 month ago
|
Description
•