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 Session] Use new URL Service for session restoration #85126

Closed
1 of 5 tasks
Dosant opened this issue Dec 7, 2020 · 4 comments · Fixed by #115681
Closed
1 of 5 tasks

[Search Session] Use new URL Service for session restoration #85126

Dosant opened this issue Dec 7, 2020 · 4 comments · Fixed by #115681
Labels
enhancement New value added to drive a business result Feature:Search Sessions Feature:Search Querying infrastructure in Kibana impact:high Addressing this issue will have a high level of impact on the quality/strength of our product. loe:medium Medium Level of Effort Team:DataDiscovery Discover, search (e.g. data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL.

Comments

@Dosant
Copy link
Contributor

Dosant commented Dec 7, 2020

Part of #61738

Original issue name: Restore sessions in apps that don't have the state stored in the URL (Lens, Canvas)

Original description

Problem:

We planned to rely on the URL to restore a background search session:

Untitled-2020-12-07-1233

The problem is that not every app has all of its state stored in the URL, so not every app can support restoring all the states from the URL.

For example,


A possible alternative to generating a restoration URL is to navigate with the state in history.
Dashboard, Visualize and Lens already use this approach to "Save and return" flow when going back to dashboard from an editor: https://github.com/elastic/kibana/blob/master/src/plugins/embeddable/public/lib/state_transfer/embeddable_state_transfer.ts#L137

Untitled-2020-12-07-1233-2

For session restoration, we use URL generators that will be removed in favor of the new URL service issue, rfc.

New URL service will allow transferring of a state using location state which will unblock apps that can't restore state from the URL from using search sessions (Lens, Canvas, some dashboard edge cases).

  • Wait until new URL service is implemented [Meta] URL Service #87304
  • Refactor search-sessions to replace URL generators with new locators
    • Create Discover locator
    • Create Dashboard locator
    • Setup search session saved object migrations. Setup migrations to migrate from url generators to locators. Use registered locators for future app state migrations.

This blocks #84908 unless we want to make first version where "send to background" is not available for viz with non-saved changes (also in this case saved session will break if lens viz changed after background search is saved)

cc @flash1293 @ThomThomson @lizozom @lukasolson @ppisljar

@Dosant Dosant added Feature:Search Querying infrastructure in Kibana enhancement New value added to drive a business result Team:AppServices labels Dec 7, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app-services (Team:AppServices)

@Dosant Dosant changed the title [Search] Make URL generation to restore a background search optional [Search Session] Restore sessions in apps which don't have the state stored in the URL (Lens, Canvas) Mar 1, 2021
@Dosant
Copy link
Contributor Author

Dosant commented Apr 15, 2021

The new URL service issue, rfc that will become a replacement of URL generators will allow passing the whole state as part of history state during navigation. This nicely solves the search-session restoration use-cases for an app the do not store the state in the URL.

I think the plan with this is:

  • Wait for URL service implemented
  • Refactor search-sessions implementation to use new URL service and locators by replacing old URL generators.

This will untie search-sessions from state in the URL as canvas/lens-editor will be able to create locators that just forward state as part of broweser history state.

@Dosant Dosant changed the title [Search Session] Restore sessions in apps which don't have the state stored in the URL (Lens, Canvas) [Search Session] Use new URL Service for session restoration Apr 15, 2021
@exalate-issue-sync exalate-issue-sync bot added impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. loe:small Small Level of Effort loe:medium Medium Level of Effort and removed loe:small Small Level of Effort labels Apr 26, 2021
@petrklapka petrklapka added 1 and removed 1 labels May 6, 2021
@exalate-issue-sync exalate-issue-sync bot added impact:high Addressing this issue will have a high level of impact on the quality/strength of our product. and removed impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. labels Sep 29, 2021
@lukasolson
Copy link
Member

Can we write a migration to move existing saved search sessions to move to locators?

@petrklapka petrklapka added Team:DataDiscovery Discover, search (e.g. data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL. and removed Team:AppServicesSv labels Nov 21, 2022
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-data-discovery (Team:DataDiscovery)

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 Sessions Feature:Search Querying infrastructure in Kibana impact:high Addressing this issue will have a high level of impact on the quality/strength of our product. loe:medium Medium Level of Effort Team:DataDiscovery Discover, search (e.g. data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants