Skip to content

fix(client): load the review before the websocket opens - #419

Merged
moritzwilksch merged 3 commits into
mainfrom
mw/slow-startup
Oct 29, 2026
Merged

moritzwilksch merged 3 commits into
mainfrom
mw/slow-startup

Conversation

@moritzwilksch

Copy link
Copy Markdown
Owner

In Firefox, a new diffle tab could hang on "Loading snapshot…" for 10 to 50 seconds. Firefox lets only one WebSocket to a host connect at a time. When another tab's socket hangs, for example an old diffle tab reconnecting to a frozen server on another port, Firefox holds the new tab's socket back until its 20 s connect timeout. The client only booted once its socket opened, so the review waited too.

  • Boot over HTTP at once. The tab loads the review on mount and no longer waits for the socket. Every socket open still resyncs, as before, so nothing pushed before the socket subscribed is lost. In a Firefox repro with a hung socket to another port, the new tab now renders in about 150 ms instead of 19 s.
  • Give up on a hung connect after 2 s. connectWs closes an attempt that has not opened and retries with the usual backoff. A diffle tab no longer blocks other tabs' sockets, or other localhost apps, for 20 s per retry.
  • Correct startup line for language servers. 🧭 lsp used to say "no language server for this diff" because it printed before the servers started. LspPool::track now starts them before it returns and only syncs documents in the background.
-pub async fn track(self: &Arc<Self>, snap: &Snapshot)
+pub fn track(self: &Arc<Self>, snap: &Snapshot) -> impl Future<Output = ()> + use<>

Closes #418

@moritzwilksch
moritzwilksch marked this pull request as ready for review October 29, 2026 10:01
@moritzwilksch
moritzwilksch merged commit f49e813 into main Oct 29, 2026
24 checks passed
@moritzwilksch
moritzwilksch deleted the mw/slow-startup branch October 29, 2026 13:16
@octo-sts octo-sts Bot mentioned this pull request Oct 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Stuck on "loading snapshots" for a long time

1 participant