-
Notifications
You must be signed in to change notification settings - Fork 6k
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
Conversation
@@ -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)) |
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 test was added #29766
Which seems like a bug to me, it could have send the non hierarchical uri.
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.
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.
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.
} | ||
return fullRoute; | ||
} | ||
return data.toString(); |
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.
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
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.
I can't find a better way to convert uri to a serializable representation. all the suggestions i found is to use to string
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.
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) { |
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 this a breaking change?
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.
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
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 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.
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.
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.
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.
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()); |
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.
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?
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.
yes the framework is treated it as uri object after flutter/flutter#119968
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.
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?
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.
Ahh I see now, thanks for the link ot the framework PR.
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 modulo avoiding the change to the v1 embedding.
c21adda
to
67be28d
Compare
…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
…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
related flutter/flutter#100624
Pre-launch Checklist
///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.