[ML] Anomaly detection explorer: ensure user can change number of rows in the anomalies table #98232
Closed
alvarezmelissa87 wants to merge 2 commits intoelastic:masterfrom
Closed
[ML] Anomaly detection explorer: ensure user can change number of rows in the anomalies table #98232alvarezmelissa87 wants to merge 2 commits intoelastic:masterfrom
alvarezmelissa87 wants to merge 2 commits intoelastic:masterfrom
Conversation
Contributor
|
Pinging @elastic/ml-ui (:ml) |
Contributor
|
@elasticmachine merge upstream |
darnautov
reviewed
Apr 26, 2021
| sortField: sort && sort.field !== undefined ? sort.field : tableState.sortField, | ||
| pageIndex: page && page.index !== undefined ? pageCopy.index : tableState.pageIndex, | ||
| pageSize: page && page.size !== undefined ? pageCopy.size : tableState.pageSize, | ||
| sortField: sort && sort.field !== undefined ? pageCopy.field : tableState.sortField, |
Contributor
There was a problem hiding this comment.
The actual problem is with sortField and changes in your PR replace it with pageCopy.field which is always undefined because the updates come from the sort property. Check #98270 for more details.
Also important to note, in JavaScript, numbers and strings are not a reference type, hence creatingpageCopy doesn't affect anything, because we access index and size by value at all times.
Contributor
💚 Build SucceededMetrics [docs]Async chunks
History
To update your PR or re-run it, just comment with: |
Contributor
Author
|
Closing in lieu of #98270 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #98117
Looks like the problem is in the call to
decodehttps://github.com/elastic/kibana/blob/master/x-pack/plugins/ml/public/application/util/url_state.tsx#L51 - looks like themlAnomaliesTablebit of the URL state (in_a) causes the rison encoding to go into an endless loop of calls.I think it's due to the
pageinfo that goes into the state directly. Looks like it must be a reference thing 🤔This PR creates a copy of the
pageobject and then sends that along in the state to be encoded. This fixes the issue - I spent some time in the rison code base trying to find out why that endless loop was happening resulting in the stack size exceeded error. I'm still not 100 percent on exactly which bit is breaking it.@darnautov - might be worth chatting over the issue.
Checklist
Delete any items that are not applicable to this PR.