-
Notifications
You must be signed in to change notification settings - Fork 3.4k
[multicast_dns] MDnsClient::listen supports onError callback #8888
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
Conversation
It looks like this pull request may not have tests. Please make sure to add tests or get an explicit test exemption before merging. If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix? Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.If you believe this PR qualifies for a test exemption, contact "@test-exemption-reviewer" in the #hackers channel in Discord (don't just cc them here, they won't see it!). The test exemption team is a small volunteer group, so all reviewers should feel empowered to ask for tests, without delegating that responsibility entirely to the test exemption group. |
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
Thanks for the submission! In the future, please do not delete the checklist that is in the PR template; it is there for a reason. This PR is missing required elements described in the checklist (I’ve restored it to the PR description), which need to be addressed before it moves forward with review. I am marking the PR as a Draft. Please review the checklist, updating the PR as appropriate, and when that’s complete please feel free to mark the PR as ready for review. |
@stuartmorgan : How can a test be added? It would need to disconnect the device from WLAN beforehand. |
@vashworth: Beside a missing test, would the change make sense for you? |
…#8888) MDnsClient::Listen now supports an optional onError callback function, called in case of a stream error. If omitted any errors on the stream are considered unhandled, and will be passed to the current [Zone]'s error handler. By default unhandled async errors are treated as if they were uncaught top-level errors. This fixes an unhandled exception occuring (tested on Android), when the network is disconnected. Issue: flutter/flutter#165482
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding this! This makes sense to me.
@vashworth: Hi, what's missing for a merge? |
Needs 2 approvals. @stuartmorgan friendly ping. |
packages/multicast_dns/CHANGELOG.md
Outdated
@@ -1,3 +1,7 @@ | |||
## 0.3.2+9 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Per semver, adding new public API is a minor version change, so this should be 0.3.3.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@@ -84,13 +84,20 @@ class MDnsClient { | |||
/// for the mDNS query. If not provided, defaults to either `224.0.0.251` or | |||
/// or `FF02::FB`. | |||
/// | |||
/// The [onError] function allows to provide a callback function, called in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comments don't need to explain basic language mechanics, like that an argument allows providing something. This first sentence can just say "If provided, [onError] will be called in case of a stream error."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
/// case of a stream error. If omitted any errors on the stream are considered | ||
/// unhandled, and will be passed to the current [Zone]'s error handler. By | ||
/// default unhandled async errors are treated as if they were uncaught top-level | ||
/// errors. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This last sentence should be removed, as this is not something that this package or method controls.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
packages/multicast_dns/pubspec.yaml
Outdated
@@ -2,7 +2,7 @@ name: multicast_dns | |||
description: Dart package for performing mDNS queries (e.g. Bonjour, Avahi). | |||
repository: https://github.com/flutter/packages/tree/main/packages/multicast_dns | |||
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+multicast_dns%22 | |||
version: 0.3.2+8 | |||
version: 0.3.2+9 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
0.3.3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
- Change version to 0.3.3 - Adapt comment about new parameter
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
flutter/packages@125c117...07496eb 2025-04-02 alexander.irion@siemens.com [multicast_dns] MDnsClient::listen supports onError callback (flutter/packages#8888) 2025-04-02 15619084+vashworth@users.noreply.github.com Upgrade tests to use Xcode 16 and iOS 18 (flutter/packages#8968) 2025-04-01 engine-flutter-autoroll@skia.org Manual roll Flutter from 1d954f4 to 05b5e79 (225 revisions) (flutter/packages#8960) 2025-04-01 kevmoo@users.noreply.github.com Drop deprecated HTML head meta tags (flutter/packages#8970) 2025-04-01 stuartmorgan@google.com Adjust PR checklist formatter discussion (flutter/packages#8924) 2025-04-01 stuartmorgan@google.com Update CODEOWNERS username (flutter/packages#8933) 2025-04-01 69054810+M97Chahboun@users.noreply.github.com [flutter_markdown] Added sizedImageBuilder to Markdown widget (flutter/packages#6739) 2025-04-01 stuartmorgan@google.com [google_maps_flutter] Skip impl copy of iOS tests (flutter/packages#8975) 2025-04-01 stuartmorgan@google.com [google_maps_flutter] Skip more hanging iOS tests (flutter/packages#8967) 2025-04-01 stanleycocoa@gmail.com [url_launcher] When not fully loaded, clicking close causes the callback to not be triggered correctly. (flutter/packages#8582) 2025-04-01 robert.odrowaz@leancode.pl [camera_avfoundation] Test utils and mocks swift migration - part 2 (flutter/packages#8892) 2025-03-31 15619084+vashworth@users.noreply.github.com [webview_flutter] Skip flaky legacy tests on iOS (flutter/packages#8911) 2025-03-31 davidmartos96@gmail.com [camera_android] Don't override default fps range when not recording (flutter/packages#8891) 2025-03-31 filiph@users.noreply.github.com [google_maps_flutter] Fix typo and remove duplicitous CHANGELOG entry (flutter/packages#8754) 2025-03-31 kevmoo@users.noreply.github.com [extension_gsi] Support the latest version of googleapis_auth (flutter/packages#8931) 2025-03-31 49699333+dependabot[bot]@users.noreply.github.com [dependabot]: Bump com.android.tools.build:gradle from 8.0.0 to 8.9.1 in /packages/pigeon/platform_tests/test_plugin/android (flutter/packages#8955) 2025-03-31 linxunfeng@yeah.net [webview_flutter_wkwebview] Fixes crash when sending undefined message via javascript channel (flutter/packages#8776) 2025-03-31 49699333+dependabot[bot]@users.noreply.github.com [dependabot]: Bump com.android.tools.build:gradle from 8.0.0 to 8.9.1 in /packages/pigeon/platform_tests/alternate_language_test_plugin/android (flutter/packages#8946) 2025-03-31 10687576+bparrishMines@users.noreply.github.com [interactive_media_ads] Fixes `AdEventType`s not triggering on iOS in release mode (flutter/packages#8918) 2025-03-31 stuartmorgan@google.com [google_maps_flutter] Skip test that hangs iOS CI (flutter/packages#8958) 2025-03-28 engine-flutter-autoroll@skia.org Manual roll Flutter from b16430b to 1d954f4 (114 revisions) (flutter/packages#8922) 2025-03-28 robert.odrowaz@leancode.pl [camera_avfoundation] Test utils and mocks swift migration - part 3 (flutter/packages#8912) 2025-03-27 jacksongardner@google.com Use a more deterministic way of waiting for ad widgets to be ready. (flutter/packages#8920) 2025-03-27 robert.odrowaz@leancode.pl [camera_avfoundation] Test utils and mocks swift migration - part 1 (flutter/packages#8890) 2025-03-27 tarrinneal@gmail.com [pigeon] correct usage of extended generics in generator methods (flutter/packages#8910) 2025-03-27 34892635+fa0311@users.noreply.github.com [video_player] Fix layout issue caused by `Transform.rotate` not affecting space calculation. (flutter/packages#8685) 2025-03-27 43759233+kenzieschmoll@users.noreply.github.com [shared_preferences] Fix a late initialized error with the example app (flutter/packages#8540) 2025-03-26 stuartmorgan@google.com [various] Disable sandbox in Chrome dart tests (flutter/packages#8909) 2025-03-25 stuartmorgan@google.com [tool] Move changed file detection to base command class (flutter/packages#8730) 2025-03-25 34327253+lenzpaul@users.noreply.github.com [Camera] Add lens type information (iOS) (flutter/packages#8723) 2025-03-25 tarrinneal@gmail.com [pigeon] kotlin equality methods (flutter/packages#8887) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages-flutter-autoroll Please CC flutter-ecosystem@google.com on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md --------- Co-authored-by: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com>
flutter/packages@125c117...07496eb 2025-04-02 alexander.irion@siemens.com [multicast_dns] MDnsClient::listen supports onError callback (flutter/packages#8888) 2025-04-02 15619084+vashworth@users.noreply.github.com Upgrade tests to use Xcode 16 and iOS 18 (flutter/packages#8968) 2025-04-01 engine-flutter-autoroll@skia.org Manual roll Flutter from 1d954f4 to 05b5e79 (225 revisions) (flutter/packages#8960) 2025-04-01 kevmoo@users.noreply.github.com Drop deprecated HTML head meta tags (flutter/packages#8970) 2025-04-01 stuartmorgan@google.com Adjust PR checklist formatter discussion (flutter/packages#8924) 2025-04-01 stuartmorgan@google.com Update CODEOWNERS username (flutter/packages#8933) 2025-04-01 69054810+M97Chahboun@users.noreply.github.com [flutter_markdown] Added sizedImageBuilder to Markdown widget (flutter/packages#6739) 2025-04-01 stuartmorgan@google.com [google_maps_flutter] Skip impl copy of iOS tests (flutter/packages#8975) 2025-04-01 stuartmorgan@google.com [google_maps_flutter] Skip more hanging iOS tests (flutter/packages#8967) 2025-04-01 stanleycocoa@gmail.com [url_launcher] When not fully loaded, clicking close causes the callback to not be triggered correctly. (flutter/packages#8582) 2025-04-01 robert.odrowaz@leancode.pl [camera_avfoundation] Test utils and mocks swift migration - part 2 (flutter/packages#8892) 2025-03-31 15619084+vashworth@users.noreply.github.com [webview_flutter] Skip flaky legacy tests on iOS (flutter/packages#8911) 2025-03-31 davidmartos96@gmail.com [camera_android] Don't override default fps range when not recording (flutter/packages#8891) 2025-03-31 filiph@users.noreply.github.com [google_maps_flutter] Fix typo and remove duplicitous CHANGELOG entry (flutter/packages#8754) 2025-03-31 kevmoo@users.noreply.github.com [extension_gsi] Support the latest version of googleapis_auth (flutter/packages#8931) 2025-03-31 49699333+dependabot[bot]@users.noreply.github.com [dependabot]: Bump com.android.tools.build:gradle from 8.0.0 to 8.9.1 in /packages/pigeon/platform_tests/test_plugin/android (flutter/packages#8955) 2025-03-31 linxunfeng@yeah.net [webview_flutter_wkwebview] Fixes crash when sending undefined message via javascript channel (flutter/packages#8776) 2025-03-31 49699333+dependabot[bot]@users.noreply.github.com [dependabot]: Bump com.android.tools.build:gradle from 8.0.0 to 8.9.1 in /packages/pigeon/platform_tests/alternate_language_test_plugin/android (flutter/packages#8946) 2025-03-31 10687576+bparrishMines@users.noreply.github.com [interactive_media_ads] Fixes `AdEventType`s not triggering on iOS in release mode (flutter/packages#8918) 2025-03-31 stuartmorgan@google.com [google_maps_flutter] Skip test that hangs iOS CI (flutter/packages#8958) 2025-03-28 engine-flutter-autoroll@skia.org Manual roll Flutter from b16430b to 1d954f4 (114 revisions) (flutter/packages#8922) 2025-03-28 robert.odrowaz@leancode.pl [camera_avfoundation] Test utils and mocks swift migration - part 3 (flutter/packages#8912) 2025-03-27 jacksongardner@google.com Use a more deterministic way of waiting for ad widgets to be ready. (flutter/packages#8920) 2025-03-27 robert.odrowaz@leancode.pl [camera_avfoundation] Test utils and mocks swift migration - part 1 (flutter/packages#8890) 2025-03-27 tarrinneal@gmail.com [pigeon] correct usage of extended generics in generator methods (flutter/packages#8910) 2025-03-27 34892635+fa0311@users.noreply.github.com [video_player] Fix layout issue caused by `Transform.rotate` not affecting space calculation. (flutter/packages#8685) 2025-03-27 43759233+kenzieschmoll@users.noreply.github.com [shared_preferences] Fix a late initialized error with the example app (flutter/packages#8540) 2025-03-26 stuartmorgan@google.com [various] Disable sandbox in Chrome dart tests (flutter/packages#8909) 2025-03-25 stuartmorgan@google.com [tool] Move changed file detection to base command class (flutter/packages#8730) 2025-03-25 34327253+lenzpaul@users.noreply.github.com [Camera] Add lens type information (iOS) (flutter/packages#8723) 2025-03-25 tarrinneal@gmail.com [pigeon] kotlin equality methods (flutter/packages#8887) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages-flutter-autoroll Please CC flutter-ecosystem@google.com on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md --------- Co-authored-by: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com>
…#8888) MDnsClient::Listen now supports an optional onError callback function, called in case of a stream error. If omitted any errors on the stream are considered unhandled, and will be passed to the current [Zone]'s error handler. By default unhandled async errors are treated as if they were uncaught top-level errors. This fixes an unhandled exception occuring (tested on Android), when the network is disconnected. Fixes flutter/flutter#165482 ## Pre-Review Checklist [^1]: Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. How can a test be added? It would need to disconnect the device from WLAN beforehand.
…#8888) MDnsClient::Listen now supports an optional onError callback function, called in case of a stream error. If omitted any errors on the stream are considered unhandled, and will be passed to the current [Zone]'s error handler. By default unhandled async errors are treated as if they were uncaught top-level errors. This fixes an unhandled exception occuring (tested on Android), when the network is disconnected. Fixes flutter/flutter#165482 ## Pre-Review Checklist [^1]: Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. How can a test be added? It would need to disconnect the device from WLAN beforehand.
…er#166457) flutter/packages@125c117...07496eb 2025-04-02 alexander.irion@siemens.com [multicast_dns] MDnsClient::listen supports onError callback (flutter/packages#8888) 2025-04-02 15619084+vashworth@users.noreply.github.com Upgrade tests to use Xcode 16 and iOS 18 (flutter/packages#8968) 2025-04-01 engine-flutter-autoroll@skia.org Manual roll Flutter from 1d954f4 to 05b5e79 (225 revisions) (flutter/packages#8960) 2025-04-01 kevmoo@users.noreply.github.com Drop deprecated HTML head meta tags (flutter/packages#8970) 2025-04-01 stuartmorgan@google.com Adjust PR checklist formatter discussion (flutter/packages#8924) 2025-04-01 stuartmorgan@google.com Update CODEOWNERS username (flutter/packages#8933) 2025-04-01 69054810+M97Chahboun@users.noreply.github.com [flutter_markdown] Added sizedImageBuilder to Markdown widget (flutter/packages#6739) 2025-04-01 stuartmorgan@google.com [google_maps_flutter] Skip impl copy of iOS tests (flutter/packages#8975) 2025-04-01 stuartmorgan@google.com [google_maps_flutter] Skip more hanging iOS tests (flutter/packages#8967) 2025-04-01 stanleycocoa@gmail.com [url_launcher] When not fully loaded, clicking close causes the callback to not be triggered correctly. (flutter/packages#8582) 2025-04-01 robert.odrowaz@leancode.pl [camera_avfoundation] Test utils and mocks swift migration - part 2 (flutter/packages#8892) 2025-03-31 15619084+vashworth@users.noreply.github.com [webview_flutter] Skip flaky legacy tests on iOS (flutter/packages#8911) 2025-03-31 davidmartos96@gmail.com [camera_android] Don't override default fps range when not recording (flutter/packages#8891) 2025-03-31 filiph@users.noreply.github.com [google_maps_flutter] Fix typo and remove duplicitous CHANGELOG entry (flutter/packages#8754) 2025-03-31 kevmoo@users.noreply.github.com [extension_gsi] Support the latest version of googleapis_auth (flutter/packages#8931) 2025-03-31 49699333+dependabot[bot]@users.noreply.github.com [dependabot]: Bump com.android.tools.build:gradle from 8.0.0 to 8.9.1 in /packages/pigeon/platform_tests/test_plugin/android (flutter/packages#8955) 2025-03-31 linxunfeng@yeah.net [webview_flutter_wkwebview] Fixes crash when sending undefined message via javascript channel (flutter/packages#8776) 2025-03-31 49699333+dependabot[bot]@users.noreply.github.com [dependabot]: Bump com.android.tools.build:gradle from 8.0.0 to 8.9.1 in /packages/pigeon/platform_tests/alternate_language_test_plugin/android (flutter/packages#8946) 2025-03-31 10687576+bparrishMines@users.noreply.github.com [interactive_media_ads] Fixes `AdEventType`s not triggering on iOS in release mode (flutter/packages#8918) 2025-03-31 stuartmorgan@google.com [google_maps_flutter] Skip test that hangs iOS CI (flutter/packages#8958) 2025-03-28 engine-flutter-autoroll@skia.org Manual roll Flutter from b16430b to 1d954f4 (114 revisions) (flutter/packages#8922) 2025-03-28 robert.odrowaz@leancode.pl [camera_avfoundation] Test utils and mocks swift migration - part 3 (flutter/packages#8912) 2025-03-27 jacksongardner@google.com Use a more deterministic way of waiting for ad widgets to be ready. (flutter/packages#8920) 2025-03-27 robert.odrowaz@leancode.pl [camera_avfoundation] Test utils and mocks swift migration - part 1 (flutter/packages#8890) 2025-03-27 tarrinneal@gmail.com [pigeon] correct usage of extended generics in generator methods (flutter/packages#8910) 2025-03-27 34892635+fa0311@users.noreply.github.com [video_player] Fix layout issue caused by `Transform.rotate` not affecting space calculation. (flutter/packages#8685) 2025-03-27 43759233+kenzieschmoll@users.noreply.github.com [shared_preferences] Fix a late initialized error with the example app (flutter/packages#8540) 2025-03-26 stuartmorgan@google.com [various] Disable sandbox in Chrome dart tests (flutter/packages#8909) 2025-03-25 stuartmorgan@google.com [tool] Move changed file detection to base command class (flutter/packages#8730) 2025-03-25 34327253+lenzpaul@users.noreply.github.com [Camera] Add lens type information (iOS) (flutter/packages#8723) 2025-03-25 tarrinneal@gmail.com [pigeon] kotlin equality methods (flutter/packages#8887) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages-flutter-autoroll Please CC flutter-ecosystem@google.com on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md --------- Co-authored-by: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com>
…#8888) MDnsClient::Listen now supports an optional onError callback function, called in case of a stream error. If omitted any errors on the stream are considered unhandled, and will be passed to the current [Zone]'s error handler. By default unhandled async errors are treated as if they were uncaught top-level errors. This fixes an unhandled exception occuring (tested on Android), when the network is disconnected. Fixes flutter/flutter#165482 ## Pre-Review Checklist [^1]: Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. How can a test be added? It would need to disconnect the device from WLAN beforehand.
…#8888) MDnsClient::Listen now supports an optional onError callback function, called in case of a stream error. If omitted any errors on the stream are considered unhandled, and will be passed to the current [Zone]'s error handler. By default unhandled async errors are treated as if they were uncaught top-level errors. This fixes an unhandled exception occuring (tested on Android), when the network is disconnected. Fixes flutter/flutter#165482 ## Pre-Review Checklist [^1]: Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. How can a test be added? It would need to disconnect the device from WLAN beforehand.
…#8888) MDnsClient::Listen now supports an optional onError callback function, called in case of a stream error. If omitted any errors on the stream are considered unhandled, and will be passed to the current [Zone]'s error handler. By default unhandled async errors are treated as if they were uncaught top-level errors. This fixes an unhandled exception occuring (tested on Android), when the network is disconnected. Fixes flutter/flutter#165482 ## Pre-Review Checklist [^1]: Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. How can a test be added? It would need to disconnect the device from WLAN beforehand.
MDnsClient::Listen now supports an optional onError callback function,
called in case of a stream error. If omitted any errors on the stream
are considered unhandled, and will be passed to the current [Zone]'s
error handler. By default unhandled async errors are treated as if they
were uncaught top-level errors.
This fixes an unhandled exception occuring (tested on Android), when the
network is disconnected.
Fixes flutter/flutter#165482
Pre-Review Checklist
dart format
.)[shared_preferences]
pubspec.yaml
with an appropriate new version according to the pub versioning philosophy, or I have commented below to indicate which version change exemption this PR falls under1.CHANGELOG.md
to add a description of the change, following repository CHANGELOG style, or I have commented below to indicate which CHANGELOG exemption this PR falls under1.///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.
How can a test be added? It would need to disconnect the device from WLAN beforehand.
Footnotes
Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. ↩ ↩2 ↩3