Fix redundant subscription calls in result hook
What does this MR do and why?
This MR fixes a performance bug where redundant subscription calls can happen when using the result hook and manual refetches to the query. To fix this we use a isSubscribed flag to ensure we only subscribe to the websocket once when needed.
References
Screenshots or screen recordings
N/A
How to set up and validate locally
- Visit a pipeline
- Trigger an event like cancelling the pipeline in the header
- Ensure multiple subscription calls don't happen in the network console (WS)
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Related to #563128 (closed)