Skip to content

Commit eda644b

Browse files
authored
Update keepAlive configs (#1266)
* Update keepAlive configs * comment
1 parent dc8ab3a commit eda644b

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

dwds/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
- Add `DwdsEvent`s around stepping and evaluation.
1111
- Send an event to the Dart Debug Extension that contains VM service protocol URI.
1212
- Depend on `package:vm_service` version `6.1.0+1`.
13+
- Update the `keepAlive` configs to prevent accidental reuse of a connection after stopping
14+
a debug session.
1315

1416
**Breaking changes:**
1517
- `LoadStrategy`s now require a `moduleInfoForEntrypoint`.

dwds/lib/dwds.dart

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,11 @@ class Dwds {
119119
if (enableDebugExtension) {
120120
final handler = useSseForDebugBackend
121121
? SseSocketHandler(SseHandler(Uri.parse('/\$debug'),
122-
keepAlive: const Duration(seconds: 30)))
122+
// Proxy servers may actively kill long standing connections.
123+
// Allow for clients to reconnect in a short window. Making the
124+
// window too long may cause issues if the user closes a debug
125+
// session and initites a new one during the keepAlive window.
126+
keepAlive: const Duration(seconds: 2)))
123127
: WebSocketSocketHandler();
124128

125129
extensionBackend = await ExtensionBackend.start(handler, hostname);

dwds/lib/src/services/debug_service.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ class DebugService {
230230
// DDS will always connect to DWDS via web sockets.
231231
if (useSse && !spawnDds) {
232232
var sseHandler = SseHandler(Uri.parse('/$authToken/\$debugHandler'),
233-
keepAlive: const Duration(seconds: 30));
233+
keepAlive: const Duration(seconds: 2));
234234
handler = sseHandler.handler;
235235
unawaited(_handleSseConnections(
236236
sseHandler, chromeProxyService, serviceExtensionRegistry,

0 commit comments

Comments
 (0)