Repository navigation
fix(playback): record the viewer's address in admin playback history - #2967
Conversation
The admin history row took its client address from the request that finalized the session. An administrator's stop or terminate recorded the administrator's address, and an expiry recorded none. Use the address the playback session already tracks for the viewer. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
Quick104
left a comment
There was a problem hiding this comment.
Adversarial review (gpt-6.1-sol, reviewed 1c28c28)
One verified finding: reconstructed playback sessions lose the viewer address in history. The focused history-entry and session-reconstruction tests pass, but do not cover this lifecycle.
AI disclosure: Reviewed by Codex gpt-6.1-sol in T3 Code.
A session rebuilt from its recipe card after a restart, or on another replica, had no client address, so a viewer stop before any replan recorded none in admin playback history. Take it from the media request that rebuilds the session, which comes from the viewer's player. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
|
Reconstructed sessions now populate Automated check: Macroscope check run agent (gpt-6-luna). Evidence was not reviewed for correctness. Posted via Macroscope — Visible change evidence |
Problem
Related issue: N/A
Validation tasks: none
When a playback attempt ends, its admin playback history row stores the address of the request that ended it, not the viewer's address. If an administrator stops or terminates a stream, the row holds the administrator's address. If the session expires, the row holds no address. This change stores the viewer's address in both cases.
Nothing reads the column yet, so no one sees the wrong value today. A future history field or monitoring integration that shows it would surface the wrong address for every row written before the fix, so rows should be correct from now on.
Approach
The history entry now takes the address from the playback session. The session records the viewer's address when playback starts and updates it on each v3 route description. A session rebuilt from its recipe card, after a restart or on another replica, now takes the address from the media request that rebuilds it; before, it had none. Before, the entry read the address from whatever ended the session: the administrator's request for a stop or terminate, and a request-less background context for an expiry. The history upsert keeps the first
client_ipit writes, and every path that ends a session now writes the same viewer address.docs/admin-api.mdnow says what the stored address is, and that rows written by earlier server versions hold the address of the request that ended the attempt. Existing rows are left as they are.Server only. No API response includes the column, so clients and jellycompat need no follow-up.
Validation
TestReconstructSessionRestoresClientMetadatanow checks that a rebuilt session carries the rebuilding request's address. It fails on the base, where the address is empty, and passes on this branch.make lint-changed,make lint-router-recovery,make verify-local-paths, andmake test-goagainst a freshly migrated database. After the reconstruction fix: build, vet,make lint-changed, and the playback and handlers packages pass.Evidence
One admin-visible change: a session rebuilt after a server restart, or on another replica, now shows the viewer's address in Admin Activity and the account's "Watching now" card. Before, those showed no address until the session's next replan. The history fix itself changes nothing anyone sees, since no route reads that column. The evidence page holds the test output and the gate results; it has no captures of a restart mid-stream yet.
Evidence: https://evidence.siloserver.org/r/silo-server/admin-history-client-ip/
Risks
None identified. Rows written before this change keep the ending request's address, as the docs note.
Checklist
AI Disclosure
🤖 Generated with Claude Code
Note
Fix admin playback history to record the viewer's address
api.PlaybackHandler.buildAdminHistoryEntrynow uses the client address stored on the playback session instead of the address from the request that finalizes the session, in playback.goplayback.TranscodeManager.reconstructSessionnow populates the reconstructed session's client address from the request context, so rebuilt sessions retain the addressMacroscope summarized dad1129.