Specific kind of URL results in duplication of first page in DOM #5100

Closed
gabrielschulhof opened this Issue Sep 27, 2012 · 2 comments

Comments

Projects
None yet
2 participants
Contributor

gabrielschulhof commented Sep 27, 2012

http://domain/path/to/page1.html?name=value#/path/to/page1.html

This URL will result in the first page defined inside page1.html being loaded via AJAX into the DOM of page1.html. The originial copy of the first page is left unenhanced, whereas the second copy is enhanced and activated.

The faulty code appears to be inside isFirstPageUrl, which is called from loadPage to determine whether the page to be loaded is already loaded. This is the line inside isFirstPageUrl which is susceptible to the presence of a query string:

samePath = u.hrefNoHash === documentUrl.hrefNoHash || ( documentBaseDiffers && u.hrefNoHash === documentBase.hrefNoHash ),

documentUrl.hrefNoHash will nevertheless contain the query string ?name=value, so the first half of the above union will evaluate as false, even though it should be true.

Here's another query string issue to tack onto #4777.

@gabrielschulhof gabrielschulhof added a commit that referenced this issue Sep 28, 2012

@gabrielschulhof gabrielschulhof [sequence tests] Removing same-path pushState-disabled initial URL te…
…st, because of a query param bug - see #5100
60ac25d
Contributor

ldeluca commented Oct 29, 2014

@gabrielschulhof looks like you referenced this issue in a commit. Was it fixed and just never got closed by the system? Asking in case this is one of those issues that got lost since it's over 2 years old. :)

Contributor

gabrielschulhof commented Oct 29, 2014

I guess this prevents us from testing a certain set of initial circumstances via the sequence tests, but is otherwise expected behaviour.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment