dart-lang / dart-lang/webdev

DWDS may not reuse the underlying connection upon refresh

Open
#1,249 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Dart
Stars
224
Forks
94
Avg merge
7h 14m
Merged PRs (30d)
2

Description

We [check](https://github.com/dart-lang/webdev/blob/83f661c80b902e8bd7186e9739a7bcb9c22bef8e/dwds/lib/src/handlers/dev_handler.dart#L373) if the `existingConnection` `isInAKeepAlive` state so that we can reuse the connection. Until recently, a refresh would trigger the [done](https://github.com/dart-lang/sse/blob/8add37c0ec0419ce28153a03f299d44ce006a975/lib/src/server/sse_handler.dart#L238) event within `package:sse` prior to us trying to create an isolate. Now, there appears to be delay with this event. Thus the `canReuseConnection` check fails. I'm not sure if this is a regression in Chrome or some other part of infrastructure.

Contributor guide

Open the contributing guide

Research direction

Start with the canReuseConnection check and existingConnection handling in dwds/lib/src/handlers/dev_handler.dart around line 373, then compare the done event in package:sse at lib/src/server/sse_handler.dart around line 238. Trace refresh event ordering and confirm that an eligible underlying connection is reused after refresh without the check failing.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart
Domain
cli, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.