openshift / troubleshooting-panel-console-plugin

Console Plugin to add a troubleshooting side panel to display Korrel8r data
Apache License 2.0
0 stars 7 forks source link

Move the react state changes back inside the use effect to prevent the query from not being triggered #22

Closed PeterYurkovich closed 3 months ago

PeterYurkovich commented 3 months ago

Moving the preventQuery and clearError outside of the useEffect or any useMemo and useCallback's prevents the state from being updated correctly, leaving the Korrel8r API to never get called.

Here we are moving the state back into the useEffect since it't not a large enough code migration to break out the useMemo and useCallbacks

openshift-ci[bot] commented 3 months ago

@PeterYurkovich: all tests passed!

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes-sigs/prow](https://github.com/kubernetes-sigs/prow/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
zhuje commented 3 months ago

/lgtm

openshift-ci[bot] commented 3 months ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: PeterYurkovich, zhuje

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[OWNERS](https://github.com/openshift/troubleshooting-panel-console-plugin/blob/main/OWNERS)~~ [PeterYurkovich,zhuje] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment