-
Notifications
You must be signed in to change notification settings - Fork 1.7k
AppRouting should preserve hash on same-RouteId navigations #4219
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
Conversation
| // hash storage, set by tf-storage on the Polymer side. Due to async | ||
| // operators, we cannot guarantee that the initial 'navigated' action | ||
| // will be processed before any other URL-modifying logic. |
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 don't think it is purely about async operators.
For instance, if you are navigated to timeseries (#timeseries is written by HashStorage) and if you interact with the pinning, this effect will overwrite and remove #timeseries. In this case, HashStorage was not even attempt to write any hash so there is nothing timing related about this.
Could you more accurately depict the problem please?
Also I'd appreciate hash storage -> HashStorageComponent
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.
Updated the comment and dropped the part about async.
| }); | ||
|
|
||
| it('does not preserve hash upon replace for non-initial navigation', () => { | ||
| it('preserves hash upon navigations to the same route id', () => { |
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 this behavioral spec, maybe specify that this is a temporary behavior until all apps use the router?
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.
Done.
stephanwlee
left a comment
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.
Thanks for updating the comments.
Followup: #4220
AppRoutingEffects recently added logic to preserve URL hash
upon the initial 'navigated' action (see [1]). While this fixed cases
where the URL needs to be read upon initial page load, it does
not address an upcoming case needed for deeplinking pins in
Time Series.
Flow: pin a card, DeepLinkProvider serializes
?pinnedCards=in the URL which drops
#timeseries, reload the tab, theselected dashboard is no longer Time Series.
Expected: Time Series remains selected upon tab reload.
This change overcomes this issue the DeepLinkProvider by
preserving the hash upon same-RouteId navigations.
Manually checked internal TB embedders that navigating to
a different route id still clears the hash.
Googlers, see sync cl/335688801
[1] #4213