Skip to content
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

Add _eventController check in Connection._onMessage #126

Merged
merged 2 commits into from Oct 14, 2020

Conversation

kendalsickels-wf
Copy link
Collaborator

@kendalsickels-wf kendalsickels-wf commented Oct 14, 2020

Problem / Feature

When calling Browser.close() we were encountering the below error:

Bad state: Cannot add new events after calling close
2020-10-12T21:24:10.863732935Z   dart:async                                                        _BroadcastStreamController.add
2020-10-12T21:24:10.863993642Z   package:puppeteer/src/connection.dart 146:24                      Connection._onMessage
2020-10-12T21:24:10.863998503Z   ===== asynchronous gap ===========================
2020-10-12T21:24:10.864001234Z   dart:async                                                        _asyncThenWrapperHelper
2020-10-12T21:24:10.864004050Z   package:puppeteer/src/connection.dart                             Connection._onMessage
2020-10-12T21:24:10.864006811Z   ===== asynchronous gap ===========================
2020-10-12T21:24:10.864009873Z   dart:_internal                                                    CastStream.listen
2020-10-12T21:24:10.864020954Z   package:puppeteer/src/connection.dart 44:40                       new Connection._
2020-10-12T21:24:10.864024376Z   package:puppeteer/src/connection.dart 58:23                       Connection.create
2020-10-12T21:24:10.864027017Z   ===== asynchronous gap ===========================
2020-10-12T21:24:10.864029476Z   dart:async                                                        _asyncThenWrapperHelper
2020-10-12T21:24:10.864031999Z   package:puppeteer/src/connection.dart                             Connection.create
2020-10-12T21:24:10.864034785Z   package:puppeteer/src/puppeteer.dart 173:41                       Puppeteer.launch
2020-10-12T21:24:10.864037390Z   ===== asynchronous gap ===========================
2020-10-12T21:24:10.864039800Z   dart:async                                                        _asyncThenWrapperHelper
2020-10-12T21:24:10.864042402Z   package:puppeteer/src/puppeteer.dart                              Puppeteer.launch

Solution

Added another isClosed check near the beginning of Connection._onMessage

Semantic Versioning

  • The following public APIs were changed in a non-backward compatible way, this requires a major version bump:
    • [link to the API(s) in the diff]
  • New feature or public API changed in backward compatible way, this requires a minor version bump
  • No public API changes nor new features (backwards-compatible refactor or bug fix), so this can be included in a patch release

Copy link
Owner

@xvrh xvrh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you.

@xvrh
Copy link
Owner

xvrh commented Oct 14, 2020

If you want a new version on pub.dev, you can also: bump the version in the pubspec.yaml and update the changelog.

@kendalsickels-wf
Copy link
Collaborator Author

@xvrh bumped pubspec.yaml and updated changelog.

@xvrh xvrh merged commit 9513f46 into master Oct 14, 2020
@xvrh xvrh deleted the browser-close-errors branch October 14, 2020 13:08
@xvrh
Copy link
Owner

xvrh commented Oct 14, 2020

Thanks, I created the new release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants