You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[go_router] Fix Android Cold Start deep link with empty path losing scheme and authority. (#9868)
### Description
Fixes an issue where deep links with empty paths (e.g., `https://example.com`) lose their scheme and authority information during Android Cold Start.
This PR fixesflutter/flutter#174249
Detailed reproduction steps, environment information, and code sample are provided in the linked issue.
### Problem
On Android Cold Start, if the initial deep link has no path (`https://example.com`),
`_effectiveInitialLocation` incorrectly creates a new `Uri` with only `/?` instead of preserving scheme and authority.
This results in the router receiving a relative path instead of the full deep link URL.
### Solution
Use `Uri.replace(path: '/')` instead of creating a new `Uri`, so that the original scheme and authority are preserved.
## Pre-Review Checklist
**Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.
[^1]: Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling.
0 commit comments