Skip to content

🐛 Add stale data detection to 5 WebSocket hooks#13256

Merged
kubestellar-hive[bot] merged 4 commits into
mainfrom
fix/13247
May 12, 2026
Merged

🐛 Add stale data detection to 5 WebSocket hooks#13256
kubestellar-hive[bot] merged 4 commits into
mainfrom
fix/13247

Conversation

@kubestellar-hive
Copy link
Copy Markdown
Contributor

@kubestellar-hive kubestellar-hive Bot commented May 12, 2026

Fixes #13247

Extract shared useWsStaleDetection utility from useUpdateProgress pattern and apply to all 5 affected WebSocket hooks:

  • useActiveUsers
  • useClusterProgress
  • useExecSession
  • useInsightEnrichment
  • useAIPredictions

Each 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.

Copilot AI review requested due to automatic review settings May 12, 2026 07:58
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@kubestellar-prow
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign clubanderson for approval. For more information see the Code Review Process.

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

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label May 12, 2026
@netlify
Copy link
Copy Markdown

netlify Bot commented May 12, 2026

Deploy Preview for kubestellarconsole ready!

Name Link
🔨 Latest commit 3ce0526
🔍 Latest deploy log https://app.netlify.com/projects/kubestellarconsole/deploys/6a02eef22fc58900089f58e3
😎 Deploy Preview https://deploy-preview-13256.console-deploy-preview.kubestellar.io
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions
Copy link
Copy Markdown
Contributor

👋 Hey @kubestellar-hive[bot] — thanks for opening this PR!

🤖 This project is developed exclusively using AI coding assistants.

Please do not attempt to code anything for this project manually.
All contributions should be authored using an AI coding tool such as:

This ensures consistency in code style, architecture patterns, test coverage,
and commit quality across the entire codebase.


This is an automated message.

@kubestellar-prow kubestellar-prow Bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label May 12, 2026
@github-actions github-actions Bot added ai-generated Pull request generated by AI tier/2-standard copilot labels May 12, 2026
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>
@kubestellar-prow kubestellar-prow Bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels May 12, 2026
@kubestellar-hive
Copy link
Copy Markdown
Contributor Author

❌ Build Failure — TypeScript i18n key errors

The 08:16 commit introduced TypeScript errors in src/components/terminal/PodExecTerminal.tsx. The t() calls reference keys (terminal.reconnect, terminal.connect, terminal.reconnectNow, terminal.disconnect, terminal.connectionStale, terminal.connectingToPod) that are not present in the typed key union — meaning they're missing from the locale JSON files.

Fix: Add the missing keys to web/src/locales/en/common.json (or the relevant namespace) and ensure the TypeScript types regenerate.

Build run: https://github.com/kubestellar/console/actions/runs/25722305648

Copilot and others added 3 commits May 12, 2026 08:34
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>
@kubestellar-hive kubestellar-hive Bot merged commit d46680f into main May 12, 2026
31 of 32 checks passed
@kubestellar-prow kubestellar-prow Bot deleted the fix/13247 branch May 12, 2026 09:28
@github-actions
Copy link
Copy Markdown
Contributor

Thank you for your contribution! Your PR has been merged.

Check out what's new:

Stay connected: Slack #kubestellar-dev | Multi-Cluster Survey

@github-actions
Copy link
Copy Markdown
Contributor

Post-merge build verification passed

Both Go and frontend builds compiled successfully against merge commit d46680fb675b67cea827d70f4224f36af91f8b60.

@github-actions
Copy link
Copy Markdown
Contributor

✅ Post-Merge Verification: passed

Commit: d46680fb675b67cea827d70f4224f36af91f8b60
Specs run: Settings.spec.ts smoke.spec.ts
Report: https://github.com/kubestellar/console/actions/runs/25725792966

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-generated Pull request generated by AI copilot dco-signoff: yes Indicates the PR's author has signed the DCO. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. tier/2-standard

1 participant