-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[state] don't make extra $location.replace() calls #8179
Conversation
Couple of questions;
|
Yeah, the fix for that (#8022) caused the bug
It just reflects the current value of the
The tests pass locally, and this is specifically fixing the bug caused by #8022 |
return null; | ||
} | ||
|
||
if (this.isHashingEnabled()) { |
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.
Because there are so many conditionals and early-exits in this method, I think it's worth adding a comment describing the state of the app in which this condition is reached:
if (this.isHashingEnabled()) {
// If Kibana has been loaded for the first time with RISON states URL, and the user has has hashed states
// enabled, then update the URL to show the hashed states instead of the RISON states.
}
1 comment, then LGTM! |
i agree with CJ, else LGTM |
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.
2db123f
to
9c52032
Compare
@spalger Since the url state management flag was released in 4.6.4 as well, think we should backport this to 4.6, or is this a non-issue prior to 5.0? |
Yeah, I'll backport this to 4.6 |
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
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
[state] don't make extra $location.replace() calls Former-commit-id: d2aff6c
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.