-
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
[Synthetics] Fix filters persistance #152543
Conversation
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.
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) |
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.
LGTM.
Works well.
💛 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: |
@@ -95,7 +95,8 @@ export function FieldValueSelection({ | |||
|
|||
useEffect(() => { | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using useMemo won't help in parent component.
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.