Skip to content

Configure gateway heartbeat timeout#1643

Closed
samuelscheit wants to merge 3 commits intospacebarchat:masterfrom
samuelscheit2:fix/1603-gateway-heartbeat-timeout
Closed

Configure gateway heartbeat timeout#1643
samuelscheit wants to merge 3 commits intospacebarchat:masterfrom
samuelscheit2:fix/1603-gateway-heartbeat-timeout

Conversation

@samuelscheit
Copy link
Copy Markdown
Member

Summary

  • adds a gateway-specific heartbeat timeout config type/default
  • reuses shared heartbeat interval/timeout constants and validates configured timeouts against the advertised interval
  • applies the configured timeout to gateway and WebRTC heartbeat scheduling/rescheduling
  • adds deterministic timer/config/call-site tests for gateway and WebRTC heartbeat handling

Tests

  • npm run build
  • npm run lint (passes with existing deprecation warnings in src/util/util/Token.ts)
  • npm run node:tests
  • git diff --exit-code -- assets/schemas.json assets/openapi.json

Addresses the gateway heartbeat timeout TODO from #1603.

@samuelscheit samuelscheit marked this pull request as ready for review May 6, 2026 06:13
Copilot AI review requested due to automatic review settings May 6, 2026 06:13
@samuelscheit
Copy link
Copy Markdown
Member Author

Code review completed for the heartbeat timeout changes. I found no blocking issues in the final diff, and the PR is approved from this review pass.

@samuelscheit
Copy link
Copy Markdown
Member Author

PR handling status report (first pass):

Changed files:

  • src/gateway/events/Connection.ts
  • src/gateway/events/Connection.test.ts
  • src/gateway/opcodes/Heartbeat.ts
  • src/gateway/opcodes/Heartbeat.test.ts
  • src/gateway/util/Heartbeat.ts
  • src/gateway/util/Heartbeat.test.ts
  • src/util/config/Config.ts
  • src/util/config/index.ts
  • src/util/config/types/GatewayConfiguration.ts
  • src/util/config/types/GatewayConfiguration.test.ts
  • src/util/config/types/index.ts
  • src/util/util/Config.ts
  • src/webrtc/events/Connection.ts
  • src/webrtc/events/Connection.test.ts
  • src/webrtc/opcodes/Heartbeat.ts
  • src/webrtc/opcodes/Heartbeat.test.ts

Local tests run:

  • npm run build — passed (schema/OpenAPI warnings only)
  • npm run lint — passed with existing deprecation warnings in src/util/util/Token.ts
  • npm run node:tests — passed, 62/62 tests
  • git diff --exit-code -- assets/schemas.json assets/openapi.json — passed, no generated asset diff

Code-review outcome:

  • Final diff review found no blocking code issues, and the PR was marked ready for review.
  • A review-pass approval comment was posted.

Decision:

  • Needs another pass before final approval/completion because GitHub Actions Style / build (24.x) is failing on repository-wide Prettier checks for .lintstagedrc.mjs, eslint.config.mjs, and src/cdn/util/Storage.ts.

@samuelscheit
Copy link
Copy Markdown
Member Author

Second-pass code review completed after the style-fix commit. I found no blocking issues in the final diff; Style and Nix checks are both passing, and the PR is approved from this review pass.

@samuelscheit
Copy link
Copy Markdown
Member Author

Final PR handling report:

Changed files:

  • .lintstagedrc.mjs
  • eslint.config.mjs
  • src/cdn/util/Storage.ts
  • src/gateway/events/Connection.ts
  • src/gateway/events/Connection.test.ts
  • src/gateway/opcodes/Heartbeat.ts
  • src/gateway/opcodes/Heartbeat.test.ts
  • src/gateway/util/Heartbeat.ts
  • src/gateway/util/Heartbeat.test.ts
  • src/util/config/Config.ts
  • src/util/config/index.ts
  • src/util/config/types/GatewayConfiguration.ts
  • src/util/config/types/GatewayConfiguration.test.ts
  • src/util/config/types/index.ts
  • src/util/util/Config.ts
  • src/webrtc/events/Connection.ts
  • src/webrtc/events/Connection.test.ts
  • src/webrtc/opcodes/Heartbeat.ts
  • src/webrtc/opcodes/Heartbeat.test.ts

Tests and checks run:

  • npm run build — passed (schema/OpenAPI warnings only)
  • npx prettier --check . — passed
  • npm run lint — passed with existing deprecation warnings in src/util/util/Token.ts
  • npm run node:tests — passed, 62/62 tests
  • git diff --exit-code -- assets/schemas.json assets/openapi.json — passed, no generated asset diff
  • GitHub Actions Style / build (24.x) — passed
  • GitHub Actions Nix build / build-nix — passed

Code-review outcome:

  • Reviewed the final diff after the heartbeat and style-fix commits.
  • No blocking issues found.
  • PR is ready for review, mergeable, and all current checks are passing.

Decision: Approved; no another pass needed.

Copy link
Copy Markdown

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.

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.

2 participants