Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Conversation

@bkonyi
Copy link
Contributor

@bkonyi bkonyi commented Jan 25, 2023

This reverts commit 5dd9454.

@flutter-dashboard flutter-dashboard bot added embedder Related to the embedder API platform-android platform-fuchsia platform-ios platform-web Code specifically for the web engine labels Jan 25, 2023
@bkonyi bkonyi changed the title [WIP] Reland "Remove references to Observatory (#38919)" Reland "Remove references to Observatory (#38919)" Jan 25, 2023
@bkonyi
Copy link
Contributor Author

bkonyi commented Jan 25, 2023

I reverted the changes to the public APIs and marked them as deprecated. I think I caught them all, but I'm not sure where the public API boundaries are, so please let me know if I missed any.

@jmagman
Copy link
Member

jmagman commented Jan 25, 2023

What was breaking in the Flutter -> plugins roll? #39035

*/
@Deprecated
@Nullable
public static String getObservatoryUri() {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jmagman renaming this method had broken the espresso plugin.

Copy link
Member

Choose a reason for hiding this comment

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


if (err != 0) {
FML_LOG(ERROR) << "Failed to register observatory port with mDNS with error " << err << ".";
FML_LOG(ERROR) << "Failed to register Dart VM Service port with mDNS with error " << err << ".";
Copy link
Contributor

Choose a reason for hiding this comment

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

Networking in iOS is a protected resource and therefore requires permissions, specifically NSBonjourServices. Without it, this will always error and show this error message to users.

In the Flutter tools, we add in NSBonjourServices to the Info.plist on build here:
https://github.com/flutter/flutter/blob/c31856bc48596d251ade554c33a09184e69185d9/packages/flutter_tools/bin/xcode_backend.dart#L247-L285

To avoid errors, the tool should be updated first to include the new _dartVmService._tcp (and also keep the original _dartobservatory._tcp).

Copy link
Member

Choose a reason for hiding this comment

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

This code is falling back to _dartobservatory._tcp with the legacyRegistrationType check below so I think it should still work. However, it shouldn't log any errors like this of or the iOS 14 one until both fail.

@vashworth's suggestion to add both to the tool first would also work.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated to only output the error message after both registration attempts have failed.

Copy link
Member

@jmagman jmagman left a comment

Choose a reason for hiding this comment

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

Requesting changes to remove the error logs until both the _dartVmService._tcp AND _dartobservatory._tcp checks fail.

Copy link
Member

@jmagman jmagman left a comment

Choose a reason for hiding this comment

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

LGTM
@vashworth were your concerns addressed?

*/
@Deprecated
@Nullable
public static String getObservatoryUri() {
Copy link
Member

Choose a reason for hiding this comment

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

@vashworth
Copy link
Contributor

LGTM @vashworth were your concerns addressed?

Yup, LGTM too!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

embedder Related to the embedder API platform-android platform-fuchsia platform-ios platform-web Code specifically for the web engine

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants