[dwds] Fix bug where no-op hot restart doesn't cancel a subscription and publish 25.0.1 (#2668)

In hot restart, we wait for all sources to be parsed before continuing
to create the isolate. In order to do so, we listen on parsed sources
by registering a subscription. In the case where we have no sources
to restart, we don't cancel the subscription. This results in an issue
where on the next hot restart that contains changes, the old
subscription is triggered, potentially completing an already completed
completer. Instead, we should always cancel the subscription. Hot reload
code is changed as well to do the same.

Additional checks are added to check if the completer is completed
before we complete again. While this is not needed for this issue,
it is possible other sources can be downloaded by the app, which may
trigger the function in the listener, which could potentially try and
complete the completed completer.

Tests are added for both hot restart and hot reload to check that
alternating empty hot restarts and non-empty hot restarts work.
8 files changed
tree: 5ac827f6f6e33458039ea506aeee2764b84122bc
  1. .github/
  2. _analysis_config/
  3. dwds/
  4. example/
  5. fixtures/
  6. frontend_server_client/
  7. frontend_server_common/
  8. test_common/
  9. tool/
  10. webdev/
  11. .gitattributes
  12. .gitignore
  13. AUTHORS
  14. CONTRIBUTING.md
  15. mono_repo.yaml
  16. README.md
README.md

Dart

Packages

PackageDescriptionVersion
dwdsA service that proxies between the Chrome debug protocol and the Dart VM service protocol.pub package
frontend_server_clientClient code to start and interact with the frontend_server compiler from the Dart SDK.pub package
webdevA CLI for Dart web development. Provides an easy and consistent set of features for users and tools to build and deploy web applications with Dart.pub package

Publishing automation

For information about our publishing automation and release process, see https://github.com/dart-lang/ecosystem/wiki/Publishing-automation.