Skip to content

Live TV: heartbeat the session while the player is open - #44

Merged
JonahMMay merged 1 commit into
mainfrom
feat/livetv-heartbeat
Oct 13, 2026
Merged

JonahMMay merged 1 commit into
mainfrom
feat/livetv-heartbeat

Conversation

@JonahMMay

Copy link
Copy Markdown

The server reclaims a live session's tuner when nothing fetches the stream or heartbeats it for stale_after_seconds (90s), so a long pause could lose the session. Android never sent heartbeats (Apple, Roku and SmartTV do).

  • LiveTvApi.heartbeatSession: POST /api/v2/livetv/sessions/{id}/heartbeat
  • LiveTvPlayerViewModel heartbeats every stale_after_seconds / 3 (30s default) from a successful start until stop(), a new channel, onCleared, or a 404.
  • Tests: API path, heartbeat cadence and stop, and stopping on 404.

🤖 Generated with Claude Code

The server reclaims a live session's tuner when nothing fetches the stream or
heartbeats it for stale_after_seconds (90), which a long pause hits. The
player now POSTs /api/v2/livetv/sessions/{id}/heartbeat every third of that
window until stop, a new channel, or a 404 (session gone).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 13, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 20 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 9f16cfc8-b257-4e91-b431-fe2e34b33e14
📥 Commits

Reviewing files that changed from the base of the PR and between e573e59 and 8862832.

📒 Files selected for processing (7)
  • shared/src/commonMain/kotlin/org/prairieserver/prairie/network/api/LiveTvApi.kt
  • shared/src/commonMain/kotlin/org/prairieserver/prairie/repository/LiveTvRepository.kt
  • shared/src/commonMain/kotlin/org/prairieserver/prairie/viewmodel/LiveTvViewModels.kt
  • shared/src/commonTest/kotlin/org/prairieserver/prairie/model/feature/LiveTvFeatureStoreTest.kt
  • shared/src/commonTest/kotlin/org/prairieserver/prairie/network/api/LiveTvApiTest.kt
  • shared/src/commonTest/kotlin/org/prairieserver/prairie/repository/LiveTvRepositoryTest.kt
  • shared/src/commonTest/kotlin/org/prairieserver/prairie/viewmodel/LiveTvViewModelTest.kt
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@JonahMMay
JonahMMay merged commit 7d842b3 into main Oct 13, 2026
6 checks passed
@JonahMMay
JonahMMay deleted the feat/livetv-heartbeat branch October 13, 2026 00:32
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.

1 participant