Skip to content

dwds does not block main execution on page reload #2726

@iinozemtsev

Description

@iinozemtsev

When I connect to the app from an IDE and set breakpoints, they aren't hit on page refresh.

Skimming through dev_handler.dart I suspect that the issue is here:

// We can take over a connection if there is no connectedInstanceId (this
// means the client completely disconnected), or if the existing
// AppConnection is in the KeepAlive state (this means it disconnected but
// is still waiting for a possible reconnect - this happens during a page
// reload).
final canReconnect =
services != null &&
(services.connectedInstanceId == null ||
existingConnection?.isInKeepAlivePeriod == true);
. canReconnect evaluates to false, because services.connectedInstanceId isn't null and the existing connection is not in keep alive period.

I started looking at how / when dev_handler detects disconnects, and at least for me it looks like when the page is refreshed, the sse connection is not cleared at all and _injectedConnections only grows with each refresh.

Any ideas how it worked/supposed to work?

cc @bkonyi @srujzs

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions