8000 Frequent websocket disconnects on Firefox · Issue #2684 · rust-lang/mdBook · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Frequent websocket disconnects on Firefox #2684

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
ehuss opened this issue May 3, 2025 · 0 comments
Open

Frequent websocket disconnects on Firefox #2684

ehuss opened this issue May 3, 2025 · 0 comments
Labels
C-bug Category: A bug, incorrect or unintended behavior Command-serve Command: serve

Comments

@ehuss
Copy link
Contributor
ehuss commented May 3, 2025

Problem

I am having problems with websocket disconnects on the mdbook server on Firefox. I see the following in the console:

The connection to ws://localhost:3000/__livereload was interrupted while the page was loading.

I have not been able to identify what causes this to happen. It happens very frequently, often about a minute after loading a page. However, it is quite random and there isn't an obvious cause.

This does not appear to happen on Chrome or Safari, but I have not tested those very much. I also have not had a chance to see if this happens on other systems.

This started happening within the past 3-6 months, I do not recall this being an issue in the past.

There's a variety of things to investigate:

  • Is this reproducible on other systems or other browsers? Is there something unique in my setup? Is it caused by some extension?
  • If this is unique to Firefox, is there a known issue about this?
  • Is there something about our Websocket implementation that is causing this?
  • Is this reproducible on older versions of mdbook? Was this introduced by some update?

Steps

  1. Load a page
  2. Wait a few minutes
  3. Notice the websocket error, and the page will not reload when there are changes.

Possible Solution(s)

  • If this is a bug in Firefox, see if that has a fix?
  • If this is a problem in the websocket implementation, see if that can be fixed.
  • Perhaps look into some kind of keepalive? The websocket protocol has a native keepalive, but my understanding is that browsers don't really handle that? If not, maybe just sending a small ping message periodically could help.
  • Consider reconnecting if the connection is dropped? There are some potential issues with that, for example if you stop the server, and then restart it for another book. Do we want the page to reload in that scenario, or stay with the original book still open?

Notes

Firefox 137.0.2 on macOS.

Version

mdbook v0.4.48
@ehuss ehuss added C-bug Category: A bug, incorrect or unintended behavior Command-serve Command: serve labels May 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: A bug, incorrect or unintended behavior Command-serve Command: serve
Projects
None yet
Development

No branches or pull requests

1 participant
0