Skip to content

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

@Dosant

Description

@Dosant

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Feature:SearchQuerying infrastructure in KibanaFeature:Search SessionsTeam:DataDiscoveryDiscover, search (data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL. t//enhancementNew value added to drive a business resultimpact:highAddressing this issue will have a high level of impact on the quality/strength of our product.loe:mediumMedium Level of Effort

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions