-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Discover] Fix wrong sort order with empty sort URL parameter #97434
[Discover] Fix wrong sort order with empty sort URL parameter #97434
Conversation
abba7f4
to
9801524
Compare
@elasticmachine merge upstream |
@elasticmachine merge upstream |
…state-sort-handling
…-19-discover-fix-initial-state-sort-handling
…ndling' of github.com:kertal/kibana into kertal-pr-2021-04-19-discover-fix-initial-state-sort-handling
src/plugins/discover/public/application/angular/discover_state.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested on Chrome Linux. This will now sort an empty query by timestamp again. Though it will change the URL when loaded to contain that timestamp in it. I don't see how that could cause an issue thus I think that's new behavior is fine. PR LGTM once tests are green.
Co-authored-by: Tim Roes <mail@timroes.de>
💛 Build succeeded, but was flaky
Test FailuresKibana Pipeline / general / Chrome X-Pack UI Functional Tests.x-pack/test/functional/apps/dashboard/sync_colors·ts.dashboard sync colors should sync colors on dashboard by defaultStandard Out
Stack Trace
Metrics [docs]Async chunks
History
To update your PR or re-run it, just comment with: cc @kertal |
Pinging @elastic/kibana-app (Team:KibanaApp) |
…c#97434) Co-authored-by: Tim Roes <mail@timroes.de>
…c#97434) Co-authored-by: Tim Roes <mail@timroes.de> # Conflicts: # src/plugins/discover/public/application/angular/discover_state.ts
#97706) Co-authored-by: Tim Roes <mail@timroes.de> Co-authored-by: Tim Roes <mail@timroes.de>
Summary
From 7.7.0 to 7.11.0
An empty sort array ->
sort:!())
was set in the URL, until the user changed sorting actively. the default sorting was calculated for UI and request, but not added to state, and was therefore not part of the URL.7.12
In 7.12 the default sorting behavior was changed by #85561
It was possible to "unsort" the document table, this was needed for the data grid implementation.

Using legacy grid it was not possible to "unsort" using the UI.The issue with invalid sorting behavior as a result of 7.12 changes
If there was a link of a recent version used in 7.12 containing
sort:!())
, this led to the following behavior:The empty array provided by
sort:!())
in the URL was overwriting thesort
array provided by the default state (which contained the default sorting). Documents were requested unsorted. In UI it was still indicated, that it's sorted by the index pattern's default sorting (e.g. @timestamp).Testing
sort:!())
, open this URL_doc
fixes #97456
Checklist