Skip to content
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

Makes android embedding to send full uri #41836

Merged
merged 3 commits into from
May 18, 2023

Conversation

chunhtai
Copy link
Contributor

@chunhtai chunhtai commented May 8, 2023

related flutter/flutter#100624

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide and the C++, Objective-C, Java style guides.
  • I listed at least one issue that this PR fixes in the description above.
  • I added new tests to check the change I am making or feature I am adding, or Hixie said the PR is test-exempt. See testing the engine for instructions on writing and running engine tests.
  • I updated/added relevant documentation (doc comments with ///).
  • I signed the CLA.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@@ -838,7 +839,7 @@ public void itDoesNotSendPushRouteInformationMessageWhenOnNewIntentIsNonHierarch
delegate.onNewIntent(mockIntent);

// Verify that the navigation channel was not given a push route message.
verify(mockFlutterEngine.getNavigationChannel(), times(0))
verify(mockFlutterEngine.getNavigationChannel(), times(1))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This test was added #29766

Which seems like a bug to me, it could have send the non hierarchical uri.

Copy link
Contributor

Choose a reason for hiding this comment

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

The linked patch was trying to avoid a crash. This assertion is probably unnecessary.

However, we should update the comment and have some kind of assertion about what arguments actually got sent through.

@chunhtai chunhtai requested a review from reidbaker May 9, 2023 19:14
@chunhtai chunhtai marked this pull request as ready for review May 9, 2023 19:15
Copy link
Contributor

@reidbaker reidbaker left a comment

Choose a reason for hiding this comment

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

Not sure this pr should land. I am not marking it request changes so that i am not blocking the pr. Deferring to @dnfield and @camsim99 for now.

}
return fullRoute;
}
return data.toString();
Copy link
Contributor

Choose a reason for hiding this comment

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

In general you should not rely on the behavior of tostring in production code. https://www.bekk.christmas/post/2019/4/never-use-tostring()-for-behaviour

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can't find a better way to convert uri to a serializable representation. all the suggestions i found is to use to string

Copy link
Contributor

Choose a reason for hiding this comment

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

I think in this case it's probably ok, since Uri provides both a toString and a parse method that knows how to deserialize from the string produced by toString...

@@ -360,10 +360,6 @@ public void setInitialRoute(String route) {
navigationChannel.setInitialRoute(route);
}

public void pushRoute(String route) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this a breaking change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am not sure who is using this API, and if there is a way to access this API at all. I can restore it if this is needed though

Copy link
Contributor

Choose a reason for hiding this comment

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

This is the old embedder v1 API. I think there were ongoing efforts to remove it but the person(s) working on that are no longer on the team.

Copy link
Contributor

Choose a reason for hiding this comment

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

I would lean towards restoring this. Anyone using the v1 API should migrate to the v2 API, and our test coverage on v1 is pretty poor - there's no need to make it harder than it already is to use v1 API though, until we just outright remove it.

Copy link
Contributor

Choose a reason for hiding this comment

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

If it's possible, you should put this back, Otherwise LGTM

@@ -308,7 +308,7 @@ public void flutterEngineGroupGetsInitialRouteFromIntent() {
ArgumentCaptor<FlutterEngineGroup.Options> optionsCaptor =
ArgumentCaptor.forClass(FlutterEngineGroup.Options.class);
verify(flutterEngineGroup, times(1)).createAndRunEngine(optionsCaptor.capture());
assertEquals("/initial_route", optionsCaptor.getValue().getInitialRoute());
assertEquals("foo://example.com/initial_route", optionsCaptor.getValue().getInitialRoute());
Copy link
Contributor

Choose a reason for hiding this comment

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

When these strings to go the framework, are they handled as dart Uri objects? If so this is probably fine, but if not won't this cause breakages in framework apps?

Even if so, won't this cause breakages to people using toString on the Uri?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes the framework is treated it as uri object after flutter/flutter#119968

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Even if so, won't this cause breakages to people using toString on the Uri?

I am not sure if i understand, can you add more details?

Copy link
Contributor

Choose a reason for hiding this comment

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

Ahh I see now, thanks for the link ot the framework PR.

Copy link
Contributor

@dnfield dnfield left a comment

Choose a reason for hiding this comment

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

LGTM modulo avoiding the change to the v1 embedding.

@chunhtai chunhtai added the autosubmit Merge PR when tree becomes green via auto submit App label May 18, 2023
@auto-submit auto-submit bot merged commit be57de6 into flutter:main May 18, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request May 19, 2023
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request May 19, 2023
…127156)

flutter/engine@9039c2d...bca11a4

2023-05-19 yjbanov@google.com [web:a11y] support dialogs described by descendants (flutter/engine#42108)
2023-05-18 47866232+chunhtai@users.noreply.github.com Makes android embedding to send full uri (flutter/engine#41836)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-engine-flutter-autoroll
Please CC rmistry@google.com,zra@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://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
CaseyHillers pushed a commit to CaseyHillers/flutter that referenced this pull request May 24, 2023
…lutter#127156)

flutter/engine@9039c2d...bca11a4

2023-05-19 yjbanov@google.com [web:a11y] support dialogs described by descendants (flutter/engine#42108)
2023-05-18 47866232+chunhtai@users.noreply.github.com Makes android embedding to send full uri (flutter/engine#41836)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-engine-flutter-autoroll
Please CC rmistry@google.com,zra@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://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autosubmit Merge PR when tree becomes green via auto submit App platform-android
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants