-
Notifications
You must be signed in to change notification settings - Fork 8.5k
Description
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:
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,
- Lens doesn't store all of its state in the URL
- We can't recreate an "unsaved" lens URL
- Dashboard removed panels from the URL [Discuss][Meta] Dashboard By Value URL length considerations #71499
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
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)

