🐛 Add stale data detection to 5 WebSocket hooks#13256
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
✅ Deploy Preview for kubestellarconsole ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
👋 Hey @kubestellar-hive[bot] — thanks for opening this PR!
This is an automated message. |
Extract stale detection pattern from useUpdateProgress into shared useWsStaleDetection utility and apply to useActiveUsers, useClusterProgress, useExecSession, useInsightEnrichment, and useAIPredictions. Fixes #13247 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Copilot <copilot@github.com>
a46919b to
56f3330
Compare
❌ Build Failure — TypeScript i18n key errorsThe 08:16 commit introduced TypeScript errors in Fix: Add the missing keys to Build run: https://github.com/kubestellar/console/actions/runs/25722305648 |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Copilot <copilot@github.com>
Use useTranslation() hook directly in StatusIndicator instead of passing t as a prop with incompatible type signature. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Copilot <copilot@github.com>
sendInput() and resize() were incorrectly resetting the stale detection timer when sending data TO the server. Stale detection should only reset on inbound messages (ws.onmessage), not outbound sends. Without this fix, a user typing into a dead terminal would continuously reset the stale timer, preventing the stale warning from ever appearing. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Copilot <copilot@github.com>
|
Thank you for your contribution! Your PR has been merged. Check out what's new:
Stay connected: Slack #kubestellar-dev | Multi-Cluster Survey |
|
Post-merge build verification passed ✅ Both Go and frontend builds compiled successfully against merge commit |
✅ Post-Merge Verification: passedCommit: |
Fixes #13247
Extract shared
useWsStaleDetectionutility fromuseUpdateProgresspattern and apply to all 5 affected WebSocket hooks:useActiveUsersuseClusterProgressuseExecSessionuseInsightEnrichmentuseAIPredictionsEach hook now tracks last message time and transitions to a stale state after 45s of silence once the connection drops, with terminal and local cluster indicators for users.