-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
[Search Sessions] Fix restoration URL conflicts with global time sync #87488
[Search Sessions] Fix restoration URL conflicts with global time sync #87488
Conversation
…arch-session-id-kbn-url-tracker-fixes
Pinging @elastic/kibana-app-services (Team:AppServices) |
@elasticmachine merge upstream |
@elasticmachine merge upstream |
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.
Search Session ID is being properly cleaned from the URL.
Added one question, other than that LGTM!
storageInstance.setItem(storageKey, activeUrl); | ||
} | ||
|
||
function onMountApp() { | ||
unsubscribe(); | ||
const historyInstance = history || (getHistory && getHistory()) || createHashHistory(); | ||
|
||
// set mounted URL as active | ||
if (shouldTrackUrlUpdate(historyInstance.location.hash)) { |
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.
Not sure how this is related to the current PR, mind elaborating?
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.
I noted that in the description as:
This pr also fixes a bug in kbnUrlTracker where state from initial URL wasn't stored in session storage so it wouldn't appear in nav link.
I noticed this bug and needed to fix it to make artificial testing flow working:
Bug to validate that the fix works:
Load discover app using a URL with appended fake &searchSessionId=fake
Discover should loaded with an error
Go to dashboard
Check that chrome link to discover app has your URL but without searchSessionId part
In real-world this bug apparently was such a minor thing that no one never noticed
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.
How to reproduce this bug without the fix:
- Take a kibana URL with some non-default state, open it.
- Change app using nav links
- Get back to the first app using the nav link.
Broken behavior: you will land into the default state
Expected (new) behaviour: you should restore your previous state
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.
Sorry I missed this comment! 🙏
@elasticmachine merge upstream |
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.
LGTM. Tested locally, and was able to see the the discover link lost the fake searchSessionId from the URL.
@elasticmachine merge upstream |
@elasticmachine merge upstream |
ACK, will review |
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.
@elasticmachine merge upstream |
@kertal, we renamed a feature and feature flag. Now it is:
Sorry for confusion. |
💚 Build SucceededMetrics [docs]Async chunks
Page load bundle
History
To update your PR or re-run it, just comment with: |
Summary
Fixes #87149
See reproduction of the bug:
global_time_sync_720.mov
This is "an easy" fix where apps remove
searchSessionId
query param from the URL that is going to be used in chrome's nav links.Long term we should explore fetching app state from SO instead of relying on state in the URL for restoring the search session.
This pr also fixes a bug in
kbnUrlTracker
where state from initial URL wasn't stored in session storage so it wouldn't appear in nav link.How to test
This pr is hard to test without #81707 in real world.
Bug to validate that the fix works:
&searchSessionId=fake
searchSessionId
partChecklist
Delete any items that are not applicable to this PR.
For maintainers