[Synthetics] Fix filters persistance#152543
Conversation
awahab07
left a comment
There was a problem hiding this comment.
The reported problem is resolved. ✔️
Would be nice to handle the following edge case as well where an orphan option value makes the UI in an inconsistent state.
152543-Should-remove-orphan-filter-options.mov
|
Pinging @elastic/uptime (Team:uptime) |
💛 Build succeeded, but was flaky
Failed CI StepsMetrics [docs]Async chunks
Unknown metric groupsESLint disabled line counts
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: |
| setOptions(formatOptions(values, selectedValue, excludedValue, showCount)); | ||
| }, [values, selectedValue, showCount, excludedValue]); | ||
| // eslint-disable-next-line react-hooks/exhaustive-deps | ||
| }, [JSON.stringify(values), JSON.stringify(selectedValue), showCount, excludedValue]); |
There was a problem hiding this comment.
Doesn't this impact performance since it uses JSON.stringify on every render?
Can't we use useMemo in the parent component instead?
There was a problem hiding this comment.
i think in this specific case. it won't have any impact. Since it's only meant to be triggered on new fetch of the data.
There was a problem hiding this comment.
if the new fetch of the data remains same, we don't want existing component to re-render since data selection should remain same.
There was a problem hiding this comment.
Using useMemo won't help in parent component.
There was a problem hiding this comment.
i think in this specific case. it won't have any impact. Since it's only meant to be triggered on new fetch of the data.
You mean FieldValueSelection only re-renders when there is new data? Where is this logic?
Using useMemo won't help in parent component.
Why is that?
There was a problem hiding this comment.
this is being used on auto-refresh in synthetics app. so when that happens. the new data remains same , but it will trigger useMemo re-render. this is why we are doing this deep comparison. Json.stringify impact is minimal here. since data isn't big.
💔 All backports failed
Manual backportTo create the backport manually run: Questions ?Please refer to the Backport tool documentation |
|
Friendly reminder: Looks like this PR hasn’t been backported yet. |
3 similar comments
|
Friendly reminder: Looks like this PR hasn’t been backported yet. |
|
Friendly reminder: Looks like this PR hasn’t been backported yet. |
|
Friendly reminder: Looks like this PR hasn’t been backported yet. |
|
Friendly reminder: Looks like this PR hasn’t been backported yet. |
1 similar comment
|
Friendly reminder: Looks like this PR hasn’t been backported yet. |
|
Pinging @elastic/obs-ux-infra_services-team (Team:obs-ux-infra_services) |
|
I've removed the 8.7 label from this PR. It seems the automated backport failed back when the PR was merged and we likely never followed up to get this backported. At this point it's unlikely we'll release another 8.7 patch, so we'll remove the label to make the bot happy. |
|
Friendly reminder: Looks like this PR hasn’t been backported yet. |
5 similar comments
|
Friendly reminder: Looks like this PR hasn’t been backported yet. |
|
Friendly reminder: Looks like this PR hasn’t been backported yet. |
|
Friendly reminder: Looks like this PR hasn’t been backported yet. |
|
Friendly reminder: Looks like this PR hasn’t been backported yet. |
|
Friendly reminder: Looks like this PR hasn’t been backported yet. |
Summary
Fixes #152291
Keep filters persistance after monitor has been edited.