-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Support mdns when attaching to proxied devices. #146021
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
Also move the vm service discovery logic into platform-specific implementation of `Device`s. This is to avoid having platform-specific code in attach.dart.
7f482ca to
13d0145
Compare
| }, | ||
| onError: (Object e) { | ||
| // Daemon throws string types. | ||
| if (e is String && e.contains('command not understood')) { |
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.
Is it safe to ignore other errors here?
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.
Good point. Forwarded the error to the stream instead.
080de5a to
5541b8d
Compare
| timeout: const Duration(seconds: 30), | ||
| slowWarningCallback: () { | ||
| // If relying on mDNS to find Dart VM Service, remind the user to allow local network permissions. | ||
| if (vmServiceDiscovery.usesMdns) { |
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 status message is only relevant to iOS devices.
| if (vmServiceDiscovery.usesMdns) { | |
| if (vmServiceDiscovery.usesMdns && _isIOSDevice(device)) { |
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.
You made me realize that I misunderstood the comment and the message. I thought it was asking me to click "Allow" on the mac, when the dart binary wants to access network. It makes a lot more sense now.
In that case, usesMdns is not actually needed, I've removed that field. I also updated the comment and the message slightly to be clear that the permission.
Also updated _isIOSDevice below to check for device.platformType == PlatformType.ios instead of checking the type, to better support proxied devices.
PTAL, thanks!
| } on Exception { | ||
| isolateDiscoveryProtocol?.dispose(); | ||
| final List<ForwardedPort> ports = portForwarder.forwardedPorts.toList(); | ||
| ports.forEach(portForwarder.unforward); |
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.
So previously, it was
flutter/packages/flutter_tools/lib/src/commands/attach.dart
Lines 309 to 311 in 137cb4b
| for (final ForwardedPort port in ports) { | |
| await device.portForwarder.unforward(port); | |
| } |
Does putting it in a forEach wait for each?
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.
On re-reading the code, the try-catch was not added in the right place. I have moved it to the Stream<Uri> get uris getter below, and added the await back.
Thanks.
christopherfujino
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 but I'll defer to Victoria for final approval (she knows this code the best)
Removed `usesMdns`, and restore platform checking in attach.dart when showing the message asking user to allow network access on device. Fix error handling in FuchsiaDevice.
vashworth
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!
|
Analyzer issue in test |
Oops, missed that one. Fixed, thanks for the review! |
flutter/flutter@4967a94...97cd47a 2024-04-10 [email protected] Roll Flutter Engine from eaf73cd39cf8 to cee489a4e275 (2 revisions) (flutter/flutter#146541) 2024-04-10 [email protected] Roll Flutter Engine from e4e274898efc to eaf73cd39cf8 (6 revisions) (flutter/flutter#146538) 2024-04-09 [email protected] Correct doc for AnimationMin (flutter/flutter#146531) 2024-04-09 [email protected] Roll Flutter Engine from 5dca50d3e268 to e4e274898efc (2 revisions) (flutter/flutter#146527) 2024-04-09 49699333+dependabot[bot]@users.noreply.github.com Bump codecov/codecov-action from 4.2.0 to 4.3.0 (flutter/flutter#146528) 2024-04-09 [email protected] Fix InputDecorator label position ignore visual density (flutter/flutter#146488) 2024-04-09 [email protected] Roll Flutter Engine from 5a824e22deb2 to 5dca50d3e268 (10 revisions) (flutter/flutter#146524) 2024-04-09 [email protected] Support mdns when attaching to proxied devices. (flutter/flutter#146021) 2024-04-09 [email protected] Fix skwasm tests (flutter/flutter#145570) 2024-04-09 [email protected] Roll pub packages (flutter/flutter#146515) 2024-04-09 [email protected] Roll Packages from 6b4d8b6 to 17f55d3 (6 revisions) (flutter/flutter#146508) 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 Please CC [email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Packages: 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
Also move the vm service discovery logic into platform-specific implementation of `Device`s. This is to avoid having platform-specific code in attach.dart.
flutter/flutter@4967a94...97cd47a 2024-04-10 [email protected] Roll Flutter Engine from eaf73cd39cf8 to cee489a4e275 (2 revisions) (flutter/flutter#146541) 2024-04-10 [email protected] Roll Flutter Engine from e4e274898efc to eaf73cd39cf8 (6 revisions) (flutter/flutter#146538) 2024-04-09 [email protected] Correct doc for AnimationMin (flutter/flutter#146531) 2024-04-09 [email protected] Roll Flutter Engine from 5dca50d3e268 to e4e274898efc (2 revisions) (flutter/flutter#146527) 2024-04-09 49699333+dependabot[bot]@users.noreply.github.com Bump codecov/codecov-action from 4.2.0 to 4.3.0 (flutter/flutter#146528) 2024-04-09 [email protected] Fix InputDecorator label position ignore visual density (flutter/flutter#146488) 2024-04-09 [email protected] Roll Flutter Engine from 5a824e22deb2 to 5dca50d3e268 (10 revisions) (flutter/flutter#146524) 2024-04-09 [email protected] Support mdns when attaching to proxied devices. (flutter/flutter#146021) 2024-04-09 [email protected] Fix skwasm tests (flutter/flutter#145570) 2024-04-09 [email protected] Roll pub packages (flutter/flutter#146515) 2024-04-09 [email protected] Roll Packages from 6b4d8b6 to 17f55d3 (6 revisions) (flutter/flutter#146508) 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 Please CC [email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Packages: 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
Also move the vm service discovery logic into platform-specific implementation of
Devices. This is to avoid having platform-specific code in attach.dart.Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.