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

[BUG] Timefield (global state) is not captured when migrate url for Discover from 2.9 to 2.11 #6766

Closed
ananzh opened this issue May 10, 2024 · 0 comments
Assignees
Labels
bug Something isn't working discover for discover reinvent v2.15.0

Comments

@ananzh
Copy link
Member

ananzh commented May 10, 2024

Describe the bug

When clicks a legacy discover url, it redirect to new URL with data_explorer parameter. But timefield is not set , it only shows the last 15minutes in the timefield filter section. Here is a url from 2.9:

/app/discover#/?_g=(filters:!(),refreshInterval:(pause:!t,value:0),time:(from:'2024-04-03T03:30:00.000Z',to:'2024-05-03T04:30:00.000Z'))&_a=(columns:!(_source),filters:!(('$state':(store:appState),meta:(alias:!n,disabled:!f,index:ff959d40-b880-11e8-a6d9-e546fe2bba5f,key:category.keyword,negate:!t,params:(query:'Men!'s%20Clothing'),type:phrase),query:(match_phrase:(category.keyword:'Men!'s%20Clothing'))),('$state':(store:appState),meta:(alias:!n,disabled:!f,index:ff959d40-b880-11e8-a6d9-e546fe2bba5f,key:currency,negate:!f,params:(query:EUR),type:phrase),query:(match_phrase:(currency:EUR)))),index:ff959d40-b880-11e8-a6d9-e546fe2bba5f,interval:auto,query:(language:kuery,query:''),sort:!()) 

It will become

/app/data-explorer/discover/#?_a=(discover:(columns:!(_source),interval:auto,sort:!()),metadata:(indexPattern:ff959d40-b880-11e8-a6d9-e546fe2bba5f,view:discover),vis-builder-editor:(errors:(),savedVisBuilderId:'',status:loading),vis-builder-style:(),vis-builder-ui:(),vis-builder-visualization:(searchField:''))&_q=(filters:!(('$state':(store:appState),meta:(alias:!n,disabled:!f,index:ff959d40-b880-11e8-a6d9-e546fe2bba5f,key:category.keyword,negate:!t,params:(query:'Men!'s%20Clothing'),type:phrase),query:(match_phrase:(category.keyword:'Men!'s%20Clothing'))),('$state':(store:appState),meta:(alias:!n,disabled:!f,index:ff959d40-b880-11e8-a6d9-e546fe2bba5f,key:currency,negate:!f,params:(query:EUR),type:phrase),query:(match_phrase:(currency:EUR)))),query:(language:kuery,query:''))&_g=(filters:!(),refreshInterval:(pause:!t,value:0),time:(from:now-15m,to:now))

The root of cause is basically _g is not migrated in the migrate_state.ts in Discover.

To Reproduce
Steps to reproduce the behavior:

  1. Go to Discover using OSD 2.9 and add some filters & query & timefield then save the url
  2. Go to Discover using OSD 2.11/2.12/2.13/2.14/main and paste the url
  3. See timefield is now-15m

Expected behavior
Capture timefield

@ananzh ananzh added bug Something isn't working untriaged discover for discover reinvent and removed untriaged labels May 10, 2024
@ananzh ananzh self-assigned this May 13, 2024
ananzh added a commit to ananzh/OpenSearch-Dashboards that referenced this issue May 13, 2024
@ananzh ananzh closed this as completed in c6820db Jun 4, 2024
opensearch-trigger-bot bot pushed a commit that referenced this issue Jun 4, 2024
* [Discover][Bug] Migrate global state

Issue Resolve
#6766

---------

Signed-off-by: Anan Zhuang <[email protected]>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
(cherry picked from commit c6820db)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
BionIT added a commit that referenced this issue Jun 5, 2024
* [Discover][Bug] Migrate global state

Issue Resolve
#6766

---------



(cherry picked from commit c6820db)

Signed-off-by: Anan Zhuang <[email protected]>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
Co-authored-by: Lu Yu <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working discover for discover reinvent v2.15.0
Projects
None yet
Development

No branches or pull requests

2 participants