-
Notifications
You must be signed in to change notification settings - Fork 8.5k
Description
Describe the bug:
When creating a multi-tab Discover session with "Store time with Discover session" disabled, then reopening and resaving it with store time enabled, unsaved changes are incorrectly detected after switching tabs:
unsaved.mp4
Steps to reproduce:
- Save a multi-tab Discover session with "Store time with Discover session" disabled.
- Clear the current Discover session with "+", then reopen the previously saved Discover session.
- Resave the open Discover session with "Store time with Discover session" enabled.
- Switch to the second tab and then back to the first tab, observe that unsaved changes are incorrectly detected for the second tab.
Expected behavior:
There should be no unsaved changes in the second tab in this scenario since the Discover session was just saved.
Any additional context:
In the Discover session saved object JSON, both tabs have "timeRestore": true
, but only the first tab actually contains a saved time range. This is probably because the second tab was uninitialized when the session was resaved with "Store time with Discover session" enabled, so no time range was set. Then when switching to the tab in Discover, a time range gets set, which triggers unsaved changes.
We'll need to decide how to handle this scenario. Maybe we default to the active tab's time range for uninitialized tabs when resaving with "Store time with Discover session" enabled?