Skip to content

[Discover] Unsaved changes incorrectly detected when updating a multi-tab Discover session to store time range #239040

@davismcphee

Description

@davismcphee

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:

  1. Save a multi-tab Discover session with "Store time with Discover session" disabled.
  2. Clear the current Discover session with "+", then reopen the previously saved Discover session.
  3. Resave the open Discover session with "Store time with Discover session" enabled.
  4. 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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Feature:DiscoverDiscover ApplicationProject:OneDiscoverEnrich Discover with contextual awarenessTeam:DataDiscoveryDiscover, search (data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL. t//bugFixes for quality problems that affect the customer experienceimpact:mediumAddressing this issue will have a medium level of impact on the quality/strength of our product.loe:needs-researchThis issue requires some research before it can be worked on or estimated

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions