Skip to content

Conversation

gibahjoe
Copy link
Contributor

@gibahjoe gibahjoe commented Dec 27, 2020

Hi,

So, this pull request addresses 2 issues i noticed. First, ModularArguments.uri was null which in turn meant fragment, queryParams and queryParamsAll were all empty. The tests didn't catch this becasue they were checking the route returned instead of route.args (I updated the tests too).

Secondly, the query params information did not exist in Modular.args because of resolverPath(String routeName, String path) method. It was removing the query params. i updated it to Uri.toString.

String resolverPath(String routeName, String path) {
final uri = Uri.parse(path);
return uri.resolve(routeName).path;
return routeName;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Previous implementation loses the query params information because Uri.path returns only the path without the query params etc. i.e for a url /signup?email=email.com, the old implementation returned /signup which doesn't have the query params any more. This wasn't caught by the tests because we were passing /signup?email=email.com directly into parser.selectRoute

I am not sure what this line uri.resolve(routeName).path does tho.

I have updated the tests also.

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 figured what it does from a failing test. I have updated the implementation to Uri.toString

updated path resolution

reverted resolverPath

updated final
@jacobaraujo7 jacobaraujo7 merged commit 0f8aefe into Flutterando:master Jan 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants