Skip to content
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][State Management] Restoring background session and back button #82419

Closed
Dosant opened this issue Nov 3, 2020 · 2 comments · Fixed by #87635
Closed

[Search][State Management] Restoring background session and back button #82419

Dosant opened this issue Nov 3, 2020 · 2 comments · Fixed by #87635
Labels
enhancement New value added to drive a business result Feature:Search Querying infrastructure in Kibana Feature:StateManagement

Comments

@Dosant
Copy link
Contributor

Dosant commented Nov 3, 2020

Part of #61738

In scope of #81633, #81489 we implemented initial ?searchSessionId query parameter support in discover and dashboard.

Initial implementation is simple and in terms of when we remove this query parameter this works in following way:

Current behavior:

  1. Land into dashboard with ?searchSessionId in the URL
  2. Initial search is executed with restored session. ?searchSessionId
  3. On state change or explicit refresh new session starts. ?searchSessionId is removed from the URL using replace
  4. Because replace was used on a browser "Back Button" we don't restore the ?searchSessionId and don't restore background search results.

Expected behavior:

  1. Land into dashboard with ?searchSessionId in the URL
  2. Initial search is executed with restored session. ?searchSessionId
  3. On state change or explicit refresh new session starts. ?searchSessionId is removed from the URL together with other URL changes.
  4. On a browser "Back Button" we restore the ?searchSessionId and restore background search results.

Why we didn't implement expected behavior initially? Doesn't sound like this should be a problem

Because of complicated state management and sync state with URL from multiple places we have to make sure the URL update which removes ?searchSessionId happens in a single transaction with other URL state updates (e.g. filter removal) to avoid multiple history entries.

This would either require an improvement to existing state syncing utils or even implementing platform api for batching history updates: #58752 (comment)

cc @lizozom @lukasolson

@Dosant Dosant added Feature:Search Querying infrastructure in Kibana enhancement New value added to drive a business result Team:AppArch Feature:StateManagement labels Nov 3, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app-arch (Team:AppArch)

@lizozom
Copy link
Contributor

lizozom commented Nov 5, 2020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New value added to drive a business result Feature:Search Querying infrastructure in Kibana Feature:StateManagement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants