-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Implement mdns for flutter run
#40447
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
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm w/ nits, but also wait for dnfield's review.
| package.id, | ||
| this, | ||
| ipv6, | ||
| debuggingOptions.observatoryPort |
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.
nit: missing comma
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this need to be public? Could it be @visibleForTesting?
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.
added @visibleForTesting
dnfield
left a comment
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 LGTM, would defer to @zanderso for final approval - in particular, do we want any analytics going on in here? How often mDNS fails, how long it takes?
Also, can you update the pull request message template? :)
| } | ||
|
|
||
| // Fallback to manual protocol discovery | ||
| printTrace('mDNS lookup failed, attempting fallback protocol discovery.'); |
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.
nit: Maybe just clarify that this is going to try to scan logs in the message.
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
zanderso
left a comment
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.
still lgtm
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?