Skip to content

fix(web): send the device name and platform on player requests - #4555

Merged
Quick104 merged 1 commit into
mainfrom
fix/web-player-device-headers
Nov 19, 2026
Merged

Quick104 merged 1 commit into
mainfrom
fix/web-player-device-headers

Conversation

@Quick104

@Quick104 Quick104 commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Related issue: N/A
Validation tasks: reaches #1206 C1 and #1207 C1 (session rows for web plays gain a platform; nothing else on the row changes)

Other clients: Apple N/A (already sends the header from its shared request layer); Android N/A (already sends it from its auth interceptor); Roku N/A (already sends roku)

Admin session rows and playback history show an empty device_platform for plays from the web app, while the admin devices list shows the same browser as, for example, "macOS Web". A developer integrating a third-party monitor reported the mismatch.

The web player's requests now carry the same device headers as the rest of the web app.

Approach

The server reads the platform from the playback start request. The web app's ordinary API calls send X-Silo-Device-Name and X-Silo-Device-Platform, which is where the devices list gets them, but the player builds its own request headers and sent only X-Silo-Device-Id.

The player's configuration now takes the web app's existing device-header function in place of a device-ID getter, so there is one detector and both paths send the same values. No server change: the session row documents device_platform as what the client declared, so a server-side lookup would contradict it.

Validation

  • Web typecheck and the player and audiobook-player test files pass on this branch.
  • On an isolated sandbox, read with an admin:monitor:read key: a play from this web build shows "device_platform": "Linux Web" on the live session row and in playback history; a play from the base commit's web app shows null on both. That run used the implementer's combined branch, which also carried two other changes now in separate pull requests.

Evidence

Evidence: https://evidence.siloserver.org/r/silo-server/pr-4555/

Risks

None identified. Every player request now carries three more short headers.

Checklist

  • I read and can explain the complete diff.
  • This pull request addresses one concern.
  • Each test this pull request adds meets "Decide what to test" in CONTRIBUTING.md.
  • The Evidence section shows every change a user can see, or how I checked a change nobody sees.

AI Disclosure

  • Harness: Claude Code in T3 Code
  • Tool(s): Claude Code, GitHub CLI
  • Model(s): claude-opus-5-5 (implementation and sandbox testing), claude-fable-5-2 (triage, review of the full diff, split into single-concern branches, this description)
  • Involvement: Fully AI-generated, human verified
  • Adversarial review: Codex (gpt-6.2-sol) reviewed head 6f2d6d7 and found nothing

🤖 Generated with Claude Code

Note

Send device name and platform headers on web player requests

Replaces getDeviceId with getDeviceHeaders in the PlayerConfig interface, so player requests now include device ID, device name, device platform, and web client-family headers instead of only the device ID. The audiobook and watch player providers use the exported helper from client.ts, and player-fetch.ts merges all returned headers into the request header map. Test fixtures are updated to the new callback shape.

  • Risk: in playerRequestHeaders, configured header values now replace existing values on name collision; PlayerConfig implementers outside the repo must migrate from getDeviceId to getDeviceHeaders.

Macroscope summarized 6f2d6d7.

The web player's requests carried X-Silo-Device-Id but not the
X-Silo-Device-Name and X-Silo-Device-Platform headers the rest of the
web app sends, so a web play reached the admin session list and history
with an empty platform. The player config now supplies the app's device
header set instead of only the id.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@coderabbitai

coderabbitai Bot commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

  • Ask an admin to enable usage-based reviews

Open in CodeRabbit

Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing.

Next included review available in 3 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e1e7887c-fd64-4432-907c-bdb53b66d609
Commits

Reviewing files that changed from the base of the PR and between bd40bd9 and 6f2d6d7.

Files selected for processing: 19

  • web/src/api/client.ts
  • web/src/pages/audiobooks/player/audiobookPlaybackContext.tsx
  • web/src/pages/audiobooks/player/useAudiobookPlayback.test.ts
  • web/src/playback/WatchPlaybackChrome.tsx
  • web/src/player/components/VideoPlayer.reconnect.test.tsx
  • web/src/player/components/VideoPlayer.test.tsx
  • web/src/player/context/PlayerConfigContext.tsx
  • web/src/player/hooks/usePlaybackRealtime.test.ts
  • web/src/player/hooks/usePlaybackSession.test.ts
  • web/src/player/hooks/useSubtitleSync.test.tsx
  • web/src/player/lifecycle-v2.test.ts
  • web/src/player/player-auth-refresh.test.ts
  • web/src/player/player-fetch.test.ts
  • web/src/player/player-fetch.ts
  • web/src/player/player-v2.test.ts
  • web/src/player/route-events-v2.test.ts
  • web/src/player/session-mutations.test.ts
  • web/src/player/start-v2.test.ts
  • web/src/player/utils/trackPreferenceWrites.test.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@silo-kody

silo-kody Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.

Reviewing changes in Silo
  • Include the related issue, expected behavior, and validation steps in the PR description.
  • For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
  • For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
  • Follow this repository's AGENTS.md and CONTRIBUTING.md.
  • Request another review with @kody start-review in a PR comment.
  • React with 👍 or 👎 to give feedback on individual suggestions.
Review settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

@silo-triage silo-triage Bot added the size/S 0–49 added + deleted lines (all files); change volume, not priority. label Nov 19, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-19T03:18:59.476199Z 6f2d6d7 PR opened
🔒 Security Review ✅ Completed 2026-11-19T03:21:07.068859Z 6f2d6d7 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@silo-triage silo-triage Bot added bug Something isn't working impact: polish Annoyance, cosmetic, or nice-to-have javascript Pull requests that update javascript code priority: P2 Limited scope, workaround exists, or polish labels Nov 19, 2026
@Quick104

Copy link
Copy Markdown
Contributor Author

Review summary

Reviewed head: 6f2d6d7

No findings. The web player now sends the same device headers as the rest of the web app: X-Silo-Device-Name, X-Silo-Device-Platform, and X-Silo-Client-Family: web, in addition to the device ID. Playback start now records a platform for web plays, so admin session rows and playback history show one.

What I checked:

  • Header collisions: none. The device headers don't overlap the auth or profile headers, and both production player configs call same-origin API routes. Media delivery, Cast, Jellyfin compatibility, and the realtime socket build their requests elsewhere and don't change.
  • Client family on settings writes: the player's subtitle writes use the profile_series scope. The server reads X-Silo-Client-Family only for profile_client, so those writes don't change.
  • Device registry: the playback start request now sends the name and platform the web app already sends on its other calls. A user's rename lives in custom_name, which the playback upsert keeps.
  • Leftover callers: none use getDeviceId. Both PlayerConfig implementers in the repo switched.
  • Tests: the PR updates fixtures only and adds no behavior test. An independent Codex review ran a mocked fetch check on base and head: the three headers are missing on base and present on head, on both the first request and the 401 retry.

Remaining for maintainers: the live sandbox check in the description ran on a combined branch that also carried two other changes, not this head alone. The mocked check above covers the request side, and the server side is unchanged.

Validated features: the PR names #1206 C1 and #1207 C1. Neither case has a recorded result yet, so no passed case is at risk. The change adds a platform to web session rows and leaves the rest of the row as it was.

User manual: unaffected. No siloserver.org page describes the session's device platform.

Other clients: Apple, Android, and Roku already send these headers. Jellyfin plays don't record a declared platform, as the API docs say, so jellycompat needs nothing.

Fit: 9/10 · Readiness: 8/10 — conditional

Fit: the client declares its own platform, which is what the session contract documents, and the player reuses the web app's existing detector instead of adding a second one. Readiness: the code is sound, and the one condition is a live check on this exact head.

Evidence: https://evidence.siloserver.org/r/silo-server/pr-4555/


Review by Claude Code (claude-opus-5-5) in T3 Code, with an adversarial pass by Codex (gpt-6.2-sol), run for the maintainer.

@Quick104
Quick104 merged commit ea639b6 into main Nov 19, 2026
19 checks passed
@Quick104
Quick104 deleted the fix/web-player-device-headers branch November 19, 2026 17:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working impact: polish Annoyance, cosmetic, or nice-to-have javascript Pull requests that update javascript code priority: P2 Limited scope, workaround exists, or polish size/S 0–49 added + deleted lines (all files); change volume, not priority.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant