angular-ui / ui-router

The de-facto solution to flexible routing with nested views in AngularJS
http://ui-router.github.io/
MIT License
13.56k stars 3.01k forks source link

ui-router does not handle hash prefixing properly if url has a query string without said hash prefix #3817

Closed brunoferreiradev07 closed 3 years ago

brunoferreiradev07 commented 3 years ago

This issue tracker is for Bug Reports and Feature Requests only.

Please direct requests for help to StackOverflow. See http://bit.ly/UIR-SOF for details.

This is a (check one box):

My version of UI-Router is: 1.0.27

Bug Report

Current Behavior:

When I share my application link on facebook, facebook suffixes my url with a "fbid" query string. The url looks like this: http://localhost:4000/?fbid=somerandomfbid. When the application finishes loading the url looks like this: http://localhost:4000/?fbid=somerandomfbid#!/pagina/1. This behaviour causes the rest of the state params to malfunction or stops the application from loading completly.

Expected Behavior:

After the application is done loading the url should be: http://localhost:4000/#!/pagina/1?fbid=somerandomfbid or http://localhost:4000/#!/pagina/1 if the query string is an invalid state param.

Link to Plunker or stackblitz that reproduces the issue:

It's hard to produce a plunker or stackblitz considering the issue is with initial navigation.