Skip to content

[4.6] [state] don't make extra $location.replace() calls#9954

Merged
spalger merged 1 commit into4.6from
jasper/backport/8179/4.6
Feb 1, 2017
Merged

[4.6] [state] don't make extra $location.replace() calls#9954
spalger merged 1 commit into4.6from
jasper/backport/8179/4.6

Conversation

@elastic-jasper
Copy link
Contributor

[state] don't make extra $location.replace() calls

Backports PR #8179

Commit 1:
[state] don't make extra $location.replace() calls

Issue:
In order to ensure BWC in the new state-hashing changes, rison encoded query string parameters are automatically converted into hashes and placed back into the URL via $location.search().replace(). This ensures that extra history entries don't get created, but this is still happening when hashing is disabled (which is now the default). This causes every state-caused history change to become a replacement, which mutilates the history stack.

Fix:
Added a #isHashingEnabled() method to the state objects that is called before trying to convert rison encoded query string states and replacing them in the URL.

Backports PR #8179

**Commit 1:**
[state] don't make extra $location.replace() calls

Issue:
In order to ensure BWC in the new state-hashing changes, rison encoded query string parameters are automatically converted into hashes and placed back into the URL via `$location.search().replace()`. This ensures that extra history entries don't get created, but this is still happening when hashing is disabled (which is now the default). This causes every state-caused history change to become a replacement, which mutilates the history stack.

Fix:
Added a `#isHashingEnabled()` method to the state objects that is called before trying to convert rison encoded query string states and replacing them in the URL.

* Original sha: 9c52032
* Authored by spalger <email@spalger.com> on 2016-09-07T17:29:12Z
@elastic-jasper elastic-jasper added the backport This PR is a backport of another PR label Jan 19, 2017
@spalger spalger added the v4.6.5 label Jan 19, 2017
@spalger spalger merged commit f0ee72d into 4.6 Feb 1, 2017
@epixa epixa deleted the jasper/backport/8179/4.6 branch February 8, 2017 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This PR is a backport of another PR v4.6.5

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants