Skip to content

feat(client-identity): report app name, version, build, and channel to the server - #153

Merged
Quick104 merged 2 commits into
mainfrom
feat/client-version-reporting
Aug 13, 2026
Merged

Quick104 merged 2 commits into
mainfrom
feat/client-version-reporting

Conversation

@Quick104

@Quick104 Quick104 commented Aug 13, 2026 •

Copy link
Copy Markdown
Contributor

Server companion: Silo-Server/silo-server#631 · Scope: Silo-Server/silo-server#630

Problem

The Apple apps sent no client name and no app version to the Silo server on ordinary requests — only X-Silo-Device-Id, -Name, -Platform, and X-Silo-Client-Family. Every iOS, tvOS, and macOS session therefore fell back to user-agent sniffing on the admin Activity page, and the server could not name the app at all, let alone the build.

The one app version that did reach the server, PlaybackV3ClientContext.appVersion, was discarded on arrival — and it dropped the build and defaulted to "0" anyway.

Changes

AppleDeviceIdentity gains clientName, appVersion (CFBundleShortVersionString), appBuild (CFBundleVersion), and channel, plus an applyHeaders(to:) extension that writes the whole identity set.

Version/build/channel are additionally exposed as bundleAppVersion / bundleAppBuild / buildChannel: bundle-only readers that skip current's keychain-backed device id. Everything that reports a version to the server now funnels through them — the HTTP headers, the playback capability snapshot, the diagnostics report header, and the hosted-installation registration — so no two carriers can disagree about the same running binary, and a capability snapshot never blocks on the Keychain to read a plist key. The three Settings screens still read Bundle.main directly; they are display-only and keep their own 1.0 / 1.0.0 UI fallbacks.

Five request paths, not four. HTTPClient's three attach sites, PairingDeviceAPI, and DownloadSessionDelegate — the last was carrying the identical 4-header block and, left alone, would have been the one Apple path still reporting no client version. Centralizing them is what stops that from recurring. HTTPClient's two near-identical attach functions now share one attachIdentityAndTrace tail, so the header set and the request trace cannot drift apart either.

Client names keep the Silo prefix to match what the Android client already sends:

Platform X-Silo-Client
tvOS Silo Apple TV
macOS Silo Mac
iOS, .pad Silo iPad
iOS, otherwise Silo iPhone

The iPhone/iPad split reuses the userInterfaceIdiom check currentClientFamily() already does.

A missing version key reports "unknown", not "0" — a broken build should look broken rather than look like version 0.

channel is dev under #if DEBUG, else the SiloBuildChannel Info.plist key (fed by the new SILO_BUILD_CHANNEL build setting), else release. All six shippable targets declare the key, extensions included: the build setting alone is not enough, and a target that carries it without the plist key silently reports release.

Realtime hello. The hello's version: "1" is the protocol version, not an app version, and is deliberately left alone (flagged in the server PR so it does not get "helpfully" wired up later). Its client.name, however, had no macOS branch, so a Mac announced itself as continuum-ios on the realtime socket while its headers said Silo Mac — the same session named two contradictory ways. Added continuum-macos. These stay protocol-level ids rather than the human-facing product names; the server has stored them since Continuum and only checks they are non-empty.

project.yml hygiene: MARKETING_VERSION / CURRENT_PROJECT_VERSION (and the new SILO_BUILD_CHANNEL) are hoisted out of six identical per-target blocks into a ShippableProduct target template. A template rather than the project-level settings.base, and that distinction is load-bearing: Xcode resolves target settings > target xcconfig > project settings, and all six targets carry a Signing/*.xcconfig ending in #include? "Local.xcconfig". At project level a contributor's gitignored Local.xcconfig silently outranks the committed version — verified, it resolves to the xcconfig value — whereas template settings land at target level where they win, the same guarantee the per-target blocks provided. CI's xcodebuild xcargs still outrank everything.

CI

TestFlight and App Store versioning is untouched. reserve_build_numbers already queries latest_testflight_build_number + 1 per platform in a preflight job and stamps it via build_app xcargs — that is already a real monotonic number matching TestFlight exactly. iOS and tvOS running independent ASC sequences is by design.

Two gaps fixed:

  1. Tag-push sideload builds shipped CFBundleVersion = 1. BUILD_NUMBER was set only on workflow_dispatch runs; on tag push it was empty, build_number_xcarg returned "", and the project.yml literal survived. Both event types now compute one.

    The counter is github.run_number, not a max or count over existing releases. A release-derived counter cannot survive the cases that matter. Prerelease tags carry no build number to read back, so v1.4.0-beta.1, -beta.2, -rc.1 and the final v1.4.0 all collapse onto the same value; and deleting a release walks the sequence backwards. Either one lets two different IPAs ship as the same version+build, which is exactly what the Activity page relies on being unambiguous. run_number is monotonic, never reused, unaffected by release deletion, and stable across a re-run (a re-run bumps run_attempt, not run_number) — so re-running a failed matrix leg reproduces the same build instead of republishing a different binary under a number that already shipped. An existing release is also re-titled each run, so the release page can never advertise a different build than the IPAs --clobber just replaced.

  2. Sideload builds now self-mark via SILO_BUILD_CHANNEL=sideload on the two unsigned lanes only, so a re-signed sideload build is distinguishable from the TestFlight build of the same version+build. The channel is also included in the client's own request log, since that is the question a user-supplied log has to answer.

Also removed a stale line in docs/release/ci-release.md claiming tvOS is skipped when iOS fails, which contradicts release.yml, and corrected docs/release/sideloading.md, which still claimed dispatch runs attach nothing to a release.

Known gap: macOS

SiloMac has no release lane — release.yml has exactly four jobs (setup, build-numbers, ios, tvos) and the Fastfile six lanes, none of which archive, stamp, or upload it. Mac builds will report 1.0.0 (build 1) until one exists.

Deferred deliberately rather than bolted on here: SiloMac has no entitlements file at all, and the Mac App Store path requires App Sandbox around bundled FFmpeg frameworks and arbitrary local-server access. Developer ID + notarized DMG is the lighter path if revisited. The channel field at least separates a developer's dev build from a Release one. Tracked in Silo-Server/silo-server#630.

Verification

xcodegen generate
xcodebuild -scheme Silo   -destination 'platform=iOS Simulator,name=iPhone 17 Pro'         ** BUILD SUCCEEDED **
xcodebuild -scheme SiloTV -destination 'platform=tvOS Simulator,name=Apple TV 4K (3rd generation)'  ** BUILD SUCCEEDED **
xcodebuild -scheme SiloMac -destination 'platform=macOS'                                    ** BUILD SUCCEEDED **

Verified in the built products that all six bundles (three apps + Top Shelf, Notification Service, Downloads Activity) carry SiloBuildChannel, and that -showBuildSettings resolves MARKETING_VERSION / CURRENT_PROJECT_VERSION / SILO_BUILD_CHANNEL on all six targets.

The xcconfig precedence claim was tested rather than reasoned about: with a Signing/Local.xcconfig containing MARKETING_VERSION = 9.9.9, the project-level layout resolved to 9.9.9 and the target-template layout holds at 1.0.0, while xcodebuild MARKETING_VERSION=1.4.0 still overrides both.

sideload-ipa.yml and project.yml parse as YAML; ruby -c fastlane/Fastfile is Syntax OK.

Risks

  • app_version now defaults to "unknown" instead of "0" when the plist key is missing; the server treats it as an opaque string, so this is safe, and it is called out in the server PR.
  • New app_build/app_channel are optional and omitted (not null) by older clients.
  • Sideload CFBundleVersion values are now sparse (they follow the workflow's run counter rather than counting 1, 2, 3 per version). They are unique and increasing, which is what the Activity page needs; they are never uploaded to App Store Connect, so no ASC sequencing constraint applies.
  • run_number resets if the workflow file is ever deleted and recreated. It is currently well above the highest published sideload build (1), and a rename does not reset it.

AI Disclosure

  • Tool(s): Claude Code
  • Model(s): claude-opus-5
  • Involvement: fully AI-generated
  • Adversarial review: a first review pass caught that the sideload build-number counter had been rewritten as a count of existing releases, which regresses when a release is deleted; it was reverted to a max-based counter. A second, deeper review then showed the max-based counter was also wrong — its clamp for non-build.N tags is a flat ceiling, so v1.4.0-beta.2, -rc.1 and v1.4.0 all mint build 2 (reproduced against fixtures: 1, 2, 2, 2). That is what drove the switch to run_number. The same pass found that hoisting the version settings into settings.base had inverted their precedence against the per-target xcconfigs (confirmed experimentally, then fixed with a target template); that SILO_BUILD_CHANNEL was set on all six targets but declared in only three Info.plists; that the capability snapshot had picked up a Keychain dependency for a plist read; and that the realtime hello still identified macOS as iOS.

…o the server

The Apple apps sent no client name and no app version to the Silo server
on ordinary requests — only device id, name, platform, and family. The
server therefore fell back to user-agent sniffing for every iOS, tvOS,
and macOS session, and the admin Activity page could not name the app,
let alone the build. The one app version that did reach the server, on
the v3 playback context, was discarded there.

AppleDeviceIdentity gains clientName, appVersion (CFBundleShortVersion-
String), appBuild (CFBundleVersion), and channel, and a new
applyHeaders(to:) writes the whole identity set. All five request paths
now go through it — HTTPClient's three attach sites, PairingDeviceAPI,
and DownloadSessionDelegate, which otherwise would have stayed the one
path reporting nothing. Client names keep the "Silo " prefix to match
what the Android client already sends: Silo iPhone, Silo iPad, Silo
Apple TV, Silo Mac.

A missing Info.plist version key now reports "unknown" rather than "0",
so a broken build looks broken instead of looking like version 0.

The realtime hello's version: "1" is left alone — it is the protocol
version, not an app version, and should not be surfaced as one.

CI: sideload builds set SILO_BUILD_CHANNEL=sideload so a re-signed build
is distinguishable from the TestFlight build of the same version, and
tag-push sideload runs now compute a build number instead of shipping
the project.yml CURRENT_PROJECT_VERSION literal of 1. That number stays
max-based rather than a count of releases, so deleting an old release
cannot walk the sequence backwards and let two different IPAs ship as
the same version+build. TestFlight and App Store versioning is
untouched: reserve_build_numbers already produces a real monotonic
per-platform number.

Note: SiloMac still has no release lane, so Mac builds report build 1
until one exists.

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

coderabbitai Bot commented Aug 13, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 3 minutes

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).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: c0c70dfe-0060-4914-a5f7-a0c49a6fcb45

📥 Commits

Reviewing files that changed from the base of the PR and between 6921e14 and f1d9cd2.

📒 Files selected for processing (20)
  • .github/workflows/sideload-ipa.yml
  • docs/release/ci-release.md
  • docs/release/sideloading.md
  • fastlane/Fastfile
  • iosApp/DownloadsActivity/Info.plist
  • iosApp/NotificationService/Info.plist
  • iosApp/TopShelf/Info.plist
  • iosApp/iosApp/Downloads/DownloadSessionDelegate.swift
  • iosApp/iosApp/Info.plist
  • iosApp/iosApp/Networking/HTTPClient.swift
  • iosApp/iosApp/Networking/HostedDiagnosticsAPI.swift
  • iosApp/iosApp/Pairing/PairingDeviceAPI.swift
  • iosApp/iosApp/Screens/Player/PlaybackRealtimeProtocol.swift
  • iosApp/iosApp/Screens/Player/ProtocolV3/ApplePlaybackV3Capabilities.swift
  • iosApp/iosApp/Screens/Player/ProtocolV3/PlaybackProtocolV3Models.swift
  • iosApp/iosApp/Shared/AppleDeviceIdentity.swift
  • iosApp/iosApp/Shared/Diagnostics/DiagnosticsCoordinator.swift
  • iosApp/iosApp/tvOS-Info.plist
  • iosApp/macOS-Info.plist
  • iosApp/project.yml

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

@cursor cursor Bot 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.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 0002f63. Configure here.

Comment thread .github/workflows/sideload-ipa.yml Resolved

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0002f6399b

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/workflows/sideload-ipa.yml Outdated
Comment on lines +108 to +110
if (( LAST < 1 )) \
&& printf '%s\n' "$TAGS" | grep -qE "^v${V//./\\.}([-+].*)?$"; then
LAST=1

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Derive unique builds for every prerelease tag

When a version has three or more tag-push releases (for example, beta.1, beta.2, and beta.3), this fallback collapses every non-build.N release to LAST=1: the first build gets 1, the second gets 2, and the third also gets 2, so different IPAs report identical version/build values despite the workflow's uniqueness goal. I checked gh release list --help; prereleases are included unless --exclude-pre-releases is passed, so these tags enter TAGS. Persist or derive each tag-push build number instead of treating all matching tags as one occupied slot.

Useful? React with 👍 / 👎.

/// The device + client identity headers every Silo request carries.
/// Kept here so no call site drifts from the others; empty values are
/// omitted rather than sent as blank headers.
func applyHeaders(to request: inout URLRequest) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Apply client identity to Top Shelf requests

When tvOS refreshes Top Shelf, TopShelfHTTPClient.get constructs authenticated requests to Silo /api/v1/... endpoints but never invokes this helper. Those requests therefore still send neither the existing device identity nor the new client/version/build/channel headers, leaving Top Shelf activity dependent on user-agent fallback. Apply the helper there too, and expose SiloBuildChannel in the extension plist so sideload requests are not mislabeled as release builds.

AGENTS.md reference: AGENTS.md:L5-L5

Useful? React with 👍 / 👎.

…recedence

Review follow-ups on the client identity work.

sideload-ipa.yml now derives CFBundleVersion from github.run_number instead
of a max over existing releases. The clamp for tags with no -build.N suffix
was a flat ceiling, so v1.4.0-beta.2, -rc.1 and v1.4.0 all minted build 2
(reproduced against fixtures: 1, 2, 2, 2), and any release-derived counter
regresses when a release is deleted. run_number is monotonic, never reused,
and stable across a re-run. An existing release is re-titled each run so the
page cannot advertise a build the attached IPAs do not carry.

project.yml moves the version/channel baseline from settings.base into a
ShippableProduct target template. At project level the per-target
Signing/*.xcconfig files — each ending in `#include? "Local.xcconfig"` —
outranked the committed version; at target level they do not.

Also:
- Declare SiloBuildChannel in the Top Shelf, Notification Service and
  Downloads Activity Info.plists. They carry the build setting but had no
  key, so they would report `release` in a sideload build.
- Read version/build/channel through bundle-only accessors on
  AppleDeviceIdentity, so a capability snapshot no longer pulls in the
  keychain-backed device id to read a plist key, and point the two
  diagnostics call sites at the same reader.
- Share one attach/trace tail between HTTPClient's two auth paths, and
  include the channel in the request log.
- Give the realtime hello a macOS client id; a Mac reported continuum-ios
  while its headers said Silo Mac.
- Fix macOS-Info.plist key ordering; refresh docs/release/sideloading.md,
  which claimed dispatch runs attach nothing to a release.

Co-Authored-By: Claude Opus 5 <[email protected]>
@Quick104
Quick104 merged commit 4a7d4a9 into main Aug 13, 2026
3 checks passed
@Quick104
Quick104 deleted the feat/client-version-reporting branch August 13, 2026 20:23

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f1d9cd2e0c

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +37 to +38
<key>SiloBuildChannel</key>
<string>$(SILO_BUILD_CHANNEL)</string>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Attach client identity to push-display requests

When the notification service extension fetches /api/v1/notifications/push/apple/display/..., ApplePushDisplayClient.fetchDisplay still attaches only auth/profile headers and Accept; moreover, the extension's source list in project.yml does not include AppleDeviceIdentity.swift. Adding SiloBuildChannel here therefore cannot make those authenticated server requests report the new client/version/build/channel identity, so notification activity continues to rely on user-agent fallback. Add a lightweight identity-header path that is compiled into and invoked by this extension.

Useful? React with 👍 / 👎.

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