Skip to content

Avoid live status heartbeat boundary race - #1951

Merged
David Pine (IEvangelist) merged 1 commit into
mainfrom
ievangelist-fix-live-status-heartbeat-timeout
Oct 26, 2026
Merged

David Pine (IEvangelist) merged 1 commit into
mainfrom
ievangelist-fix-live-status-heartbeat-timeout

Conversation

@IEvangelist

Copy link
Copy Markdown
Member

Summary

  • add a five-second grace period after three missed live-status heartbeat intervals
  • avoid closing a healthy WebSocket when the third heartbeat arrives at the stale-timer boundary
  • cover the 45-second safe boundary and 50-second stale cutoff in the unit test

Validation

  • pnpm --dir src/frontend exec vitest run --config vitest.config.ts tests/unit/live-status.vitest.test.ts — passed (20 tests)
  • pnpm --dir src/frontend exec eslint src/components/live-status.ts tests/unit/live-status.vitest.test.ts --max-warnings 0 — passed

Copilot AI balanced review requested due to automatic review settings October 26, 2026 15:57

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The focused timeout change and boundary assertions match the intended behavior, with no unresolved findings.

No open issues 🎉

What changed in this PR

This PR reduces unnecessary live-status WebSocket reconnections by allowing heartbeat jitter before treating a socket as stale.

Changes:

  • Adds a five-second grace period after three heartbeat intervals, moving the stale cutoff from 45 to 50 seconds.
  • Updates the unit test to verify the socket stays open through 49,999 milliseconds and closes at 50 seconds.
File Description
src/​frontend/​tests/​unit/​live-status.vitest.test.ts Verifies the grace period and stale-socket reconnection boundary.
src/​frontend/​src/​components/​live-status.ts Defines the heartbeat interval and grace period used to calculate the stale timeout.

Review effort: Balanced

@IEvangelist
David Pine (IEvangelist) enabled auto-merge (squash) October 26, 2026 16:16
@aspire-repo-bot

Copy link
Copy Markdown
Contributor

Frontend HTML artifact ready

The latest frontend build uploaded the frontend-dist artifact for PR #1951. Use the VS Code button below to open this PR with GitHub Artifacts Explorer and browse the built HTML locally.

VS Code: Open PR #1951 artifacts

This comment updates automatically when a new frontend build artifact is uploaded.

@IEvangelist
David Pine (IEvangelist) enabled auto-merge (squash) October 26, 2026 17:08
@IEvangelist
David Pine (IEvangelist) merged commit 43e5933 into main Oct 26, 2026
31 of 34 checks passed
@IEvangelist
David Pine (IEvangelist) deleted the ievangelist-fix-live-status-heartbeat-timeout branch October 26, 2026 17:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants