Implement mdns for flutter run#40447
Conversation
|
It looks like this pull request may not have tests. Please make sure to add tests before merging. While there are exceptions to this rule, if this patch modifies code it is probably not an exception. Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
b879271 to
f872afe
Compare
Codecov Report
@@ Coverage Diff @@
## master #40447 +/- ##
==========================================
- Coverage 59.46% 58.7% -0.77%
==========================================
Files 192 194 +2
Lines 18697 18735 +38
==========================================
- Hits 11119 10998 -121
- Misses 7578 7737 +159
Continue to review full report at Codecov.
|
zanderso
left a comment
There was a problem hiding this comment.
lgtm w/ nits, but also wait for dnfield's review.
| package.id, | ||
| this, | ||
| ipv6, | ||
| debuggingOptions.observatoryPort |
There was a problem hiding this comment.
added comma
| /// The [MDnsClient] used to do a lookup. | ||
| final MDnsClient client; | ||
|
|
||
| static const String dartObservatoryName = '_dartobservatory._tcp.local'; |
There was a problem hiding this comment.
Does this need to be public? Could it be @visibleForTesting?
There was a problem hiding this comment.
added @visibleForTesting
| } | ||
|
|
||
| // Fallback to manual protocol discovery | ||
| printTrace('mDNS lookup failed, attempting fallback protocol discovery.'); |
There was a problem hiding this comment.
nit: Maybe just clarify that this is going to try to scan logs in the message.
Description
Fixes the flutter tool not attaching to app observatory services on ios13 by implementing mDNS for
flutter run(previously the tool would discover the observatory URI via reading the logs). If mDNS fails, the tool will fallback to the old method.Related Issues
Fixes #40448
Tests
I added the following tests:
Testing both mDNS discovery, and the fallback log scanning.
Checklist
Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes (
[x]). This will ensure a smooth and quick review process.///).flutter analyze --flutter-repo) does not report any problems on my PR.Breaking Change
Does your PR require Flutter developers to manually update their apps to accommodate your change?