When hashbang is enabled, page.start() will re-add location.search params to the hash. This results in duplicate query params when the page is refreshed.
See #525 and #412
Proposed Fix
Add location.search params only when a query string has not been added to the hash.
Notes
It was a challenge to test this. I couldn't figure out how to supply a query string to the iframe window. I ended up configuring jsdom with a query string and testing against window.location. Please advise if there is a better approach.
Coverage increased (+0.4%) to 93.443% when pulling 5ce222203a2f309b6cdc219f78488940e7061af3 on jasonwoan:fix/duplicate-qs into 4f9991658f9b9e3de9b6059bade93693af24d6bd on visionmedia:master.
Problem
When
hashbang
is enabled,page.start()
will re-addlocation.search
params to the hash. This results in duplicate query params when the page is refreshed.See #525 and #412
Proposed Fix
Add
location.search
params only when a query string has not been added to the hash.Notes
It was a challenge to test this. I couldn't figure out how to supply a query string to the
iframe
window. I ended up configuring jsdom with a query string and testing againstwindow.location
. Please advise if there is a better approach.