Skip to content

fix(pairing): word phone setup failures for people, not the server - #753

Merged
Quick104 merged 2 commits into
mainfrom
fix/issue-669-pairing-failure-text
Oct 31, 2026
Merged

Quick104 merged 2 commits into
mainfrom
fix/issue-669-pairing-failure-text

Conversation

@Quick104

@Quick104 Quick104 commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Closes #669
Related issue: Silo-Server/silo-server#1192
Validation tasks: changes #336 C1

When phone or tablet setup of a TV fails, the Android setup card showed whatever text the server or the network stack produced: "Device login request has expired.", "Device login request was canceled on the device", "Cannot write application data on closed/failed TLS connection", or "Connection reset". The TV, the iPhone app, and the web page explain the same failures in plain words.

Approach

CompanionPairingCoordinator no longer passes through raw error text. A failed code lookup or approval is mapped by HTTP status to the messages the iPhone app uses:

  • 410/404: "The code expired before it was approved. Start again on ."
  • 409: "This sign-in request was already approved or declined. Start again on ."
  • 401, or a session the phone can no longer use: "Sign in to on this device again, then try again."
  • No answer from the server: "Couldn't reach . Check your connection and try again."
  • Anything else: " couldn't approve the sign-in. Try again." (or "couldn't check the code" for the lookup)

The sign-in-provider-unavailable message is unchanged. A socket or TLS failure after the phone reached the TV now reads "Connection to was lost. Try again." (the iPhone app's wording), and one before it reached the TV keeps the existing "Couldn't connect to the TV" text. The coordinator's own messages are unchanged.

The iPhone app says "this iPhone" or "this iPad" in the sign-in-again message. This change says "this device" so tablets aren't told "phone"; #668 covers the phone and tablet wording on the card.

This edits the same file as #749 (the #738 fix) in different functions; whichever merges second needs a rebase. " closed the connection. Try again." is unchanged here. The issue comment lists it because the TV reports its hardware model as its name, which #740 covers on the TV side.

Validation

  • Live, dev-builder sandbox, Android phone emulator signing in an Android TV emulator (discovery injected through a relay; the pairing session is real). With the TV's code expired during the compare step, the base build showed "Device login request has expired." This branch shows the expired-code message, and Try again reaches a fresh code. After a TV cancel and a late "Doesn't match", the base build showed the raw TLS error. This branch shows "Connection to was lost. Try again."
  • A new coordinator test fails on the base build (it shows the raw expired text) and passes with the fix.
  • ./gradlew testDebugUnitTest, the five lint tasks, and both assembleDebug builds pass. The supply-chain scripts could not run locally because ruby is missing; this change touches no build or workflow files.
  • Tablet not run separately; it shows the same card text.

Evidence

Evidence: https://evidence.siloserver.org/r/silo-android/issue-669/

Surface and build: Android phone emulator (API 34) and Android TV emulator (API 34); silo-server sandbox at 9d3f24ca.

Risks

None identified. Only the text of failures changes.

Checklist

  • I read and can explain the complete diff.
  • This pull request addresses one concern.
  • The Evidence section shows every change a user can see, or says there is none.

AI Disclosure

  • Harness: Claude Code in T3 Code
  • Tool(s): Claude Code; OpenAI Codex for the background adversarial review
  • Model(s): claude-opus-5-5; gpt-6.1-sol
  • Involvement: Fully AI-generated; not yet human verified
  • Adversarial review: no plan review, because the change only maps failure text. A background review (gpt-6.1-sol, reviewed fc4781e) found one issue: the mapping hid the app's own "update the server" notice behind a retry message. Fixed in d791a48 with a test row.

🤖 Generated with Claude Code

Note

Word phone setup failures in CompanionPairingCoordinator for people, not the server

  • Replaces raw server and exception messages with defined user-facing text for pairing failures in CompanionPairingCoordinator.kt.
  • userFacingPairingMessage now picks a connection-lost or setup-guidance message based on whether transportFactory.connect succeeded. Only nonblank IllegalStateException messages (other than SiloAuthUnavailableException) are still shown.
  • The approverFailure formatters map ApiResult.Error and ApiResult.NetworkError values to specific messages for update-required, provider-unavailable, unauthorized, conflict, and expired/missing-code cases. Other errors use the caller-provided fallback.
  • Adds signInAgain, a server-specific message for unauthorized and auth-unavailable cases, plus test coverage in CompanionPairingCoordinatorTest.kt.
  • Risk: any unclassified pairing failure now shows a generic message; check userFacingPairingMessage and approverFailure if a previously surfaced diagnostic message is needed.

Macroscope summarized d791a48.

The setup card showed the server's raw error ("Device login request has
expired.") and raw socket or TLS errors. A failed code lookup or approval
now maps the HTTP status to the same messages the iPhone app shows, and a
transport error says the connection to the TV was lost.

Closes #669

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@silo-triage silo-triage Bot added the size/M 50–199 added + deleted lines (all files); change volume, not priority. label Oct 30, 2026
@coderabbitai

coderabbitai Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

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 56 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 128 included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

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: bdbf99eb-4154-4fc4-bd9b-754fd070666f
Commits

Reviewing files that changed from the base of the PR and between 238134a and d791a48.

Files selected for processing: 2
  • android-shared/src/androidMain/kotlin/org/siloserver/silo/common/pairing/CompanionPairingCoordinator.kt
  • android-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/pairing/CompanionPairingCoordinatorTest.kt
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@silo-kody

silo-kody Bot commented Oct 30, 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 ❌

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-30T23:16:39.525161Z fc4781e PR opened
🔒 Security Review ✅ Completed 2026-10-30T23:17:12.126352Z fc4781e 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.

@macroscopeapp

macroscopeapp Bot commented Oct 30, 2026

Copy link
Copy Markdown

The pairing-failure copy in android-shared/src/androidMain/kotlin/org/siloserver/silo/common/pairing/CompanionPairingCoordinator.kt changes the error shown in the Android phone app. Please add before-and-after screenshots of the same failure state on an Android foldable both folded and open to the linked evidence page; those form factors are not covered or explained in the PR body. The coordinator is wired into the phone app, so Android TV is not an affected app surface.

Suggested fix: No diff.

Automated check: Macroscope check run agent (gpt-6-luna). Evidence was not reviewed for correctness.

Posted via Macroscope — Visible change evidence

@silo-triage silo-triage Bot added bug Something isn't working impact: polish Annoyance, cosmetic, or nice-to-have priority: P2 Limited scope, workaround exists, or polish labels Oct 30, 2026

@Quick104 Quick104 left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Adversarial review (gpt-6.1-sol, reviewed fc4781e)

One verified finding, F1, is detailed inline.

gpt-6.1-sol via Codex in T3 Code

A saved server marked as needing an update never gets a request; the API
gate answers with the app's own notice. The new failure mapping hid it
behind "Try again", which can't help. Show the notice as before.

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

silo-kody Bot commented Oct 30, 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 ❌

@Quick104

Copy link
Copy Markdown
Contributor Author

Evidence updated: phone, tablet and foldable (folded and open) before/after captures of the expired-code failure and the lost-connection failure. Devices: Pixel 8 phone, Pixel Tablet and Pixel Fold emulators (API 34) with an Android TV emulator. Before is main at 76dee90ad, after is d791a4843. Discovery between the emulators was relayed.

@Quick104
Quick104 merged commit 585111f into main Oct 31, 2026
8 of 10 checks passed
@Quick104
Quick104 deleted the fix/issue-669-pairing-failure-text branch October 31, 2026 19:39
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 priority: P2 Limited scope, workaround exists, or polish size/M 50–199 added + deleted lines (all files); change volume, not priority.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug] Phone setup shows the server's raw "Device login request has expired." text

1 participant