Skip to content

Update keepAlive configs #1266

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

Merged
merged 2 commits into from
Mar 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions dwds/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
- Add `DwdsEvent`s around stepping and evaluation.
- Send an event to the Dart Debug Extension that contains VM service protocol URI.
- Depend on `package:vm_service` version `6.1.0+1`.
- Update the `keepAlive` configs to prevent accidental reuse of a connection after stopping
a debug session.

**Breaking changes:**
- `LoadStrategy`s now require a `moduleInfoForEntrypoint`.
Expand Down
6 changes: 5 additions & 1 deletion dwds/lib/dwds.dart
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,11 @@ class Dwds {
if (enableDebugExtension) {
final handler = useSseForDebugBackend
? SseSocketHandler(SseHandler(Uri.parse('/\$debug'),
keepAlive: const Duration(seconds: 30)))
// Proxy servers may actively kill long standing connections.
// Allow for clients to reconnect in a short window. Making the
// window too long may cause issues if the user closes a debug
// session and initites a new one during the keepAlive window.
keepAlive: const Duration(seconds: 2)))
: WebSocketSocketHandler();

extensionBackend = await ExtensionBackend.start(handler, hostname);
Expand Down
2 changes: 1 addition & 1 deletion dwds/lib/src/services/debug_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ class DebugService {
// DDS will always connect to DWDS via web sockets.
if (useSse && !spawnDds) {
var sseHandler = SseHandler(Uri.parse('/$authToken/\$debugHandler'),
keepAlive: const Duration(seconds: 30));
keepAlive: const Duration(seconds: 2));
handler = sseHandler.handler;
unawaited(_handleSseConnections(
sseHandler, chromeProxyService, serviceExtensionRegistry,
Expand Down