Skip to content

fix(tv): give the server address screen Apple TV's Advanced options and errors - #758

Merged
Quick104 merged 2 commits into
mainfrom
fix/issue-743-tv-server-address
Oct 31, 2026
Merged

Quick104 merged 2 commits into
mainfrom
fix/issue-743-tv-server-address

Conversation

@Quick104

@Quick104 Quick104 commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Related issue: #743 (this covers the server address screen; #754 covers the sign-in states, and the phone setup panel and sign-out follow in their own pull requests), Silo-Server/silo-server#1192
Validation tasks: changes #337 C3 (manual server address fallback) and C4 (its remote controls); neither has been run yet.

The Android TV "Enter your server address" screen differs from Apple TV's, Roku's, and the Android phone's:

  • There are no Advanced options. Someone whose server is only reachable over plain HTTP, or on a port other than the default, has to type the scheme and port into the address. The screen offers https://, http:// and .com typing chips instead.
  • An unreachable address and a malformed one both say "Network error. Check the URL and try again.", which doesn't say which is wrong. Apple TV says "Could not reach a Silo server at that address." for the first.
  • Connect with nothing typed does nothing. Apple TV and the phone say "Please enter a server host."

Approach

The phone app's address parsing (ServerSetupScheme, buildServerSetupCandidateUrls, the cleartext check, and their tests) moves unchanged from androidApp to android-shared, and the TV uses it. Both apps now try the same addresses: Auto tries HTTPS, then HTTP, then Silo's port 8090. They also give the same errors.

On TV, the chips are replaced by an Advanced options button, as on Apple TV. It reveals Auto / HTTPS / HTTP buttons, with a check on the chosen one, and a Port: auto field. The TV's own candidate builder and its duplicate tests are removed. One TV persistence test now injects its candidate list, as the phone's version of the test does, because the shared parser refuses its silo_lan host before the guard it tests.

For a malformed address the TV now says "Enter a valid server address.", the phone's existing wording. Apple says "Please enter a valid server host." Changing it would change the phone screen too, so that's left for a follow-up.

Validation

Reproduced live on an Android TV emulator (Android 14) against a dev server, main at 238134a before and this branch after:

  • Blank Connect: before, nothing; after, "Please enter a server host."
  • http://bad host: before, "Network error. Check the URL and try again."; after, "Enter a valid server address."
  • silo.invalid (nothing answers): before, the same network error; after, "Could not reach a Silo server at that address."
  • Advanced options (after only): the sandbox's IP address with HTTP and port 8429 connected, went through the plain-HTTP prompt, and reached the sign-in screen. On the remote, Down reached Advanced options from the address field, Right moved across the protocol buttons, and Down from the port field reached Connect.

Unit tests for :androidTvApp, :android-shared and :androidApp; lintDebug for all three modules; lintVitalRelease for both apps; and both debug builds passed with no new lint findings. The phone's tests now run in android-shared, unchanged.

Evidence

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

Android TV only. The phone app's behavior and text are unchanged; only where its address code lives moved.

Risks

  • On TV, Auto now also tries port 8090 after HTTPS and HTTP, so an address nothing answers at takes one more attempt to fail. That's what the phone and Apple TV already do.
  • The TV now rejects a host the URL parser can't read, such as one with an underscore, before trying it, as the phone does. Before, it tried it and failed with a network error.
  • This edits TvServerSetupScreen.kt, which fix(tv): name the TV by its device name when it asks to sign in #746 also edits (the chip's name helper). Whichever lands second needs a small rebase.

Follow-ups

  • Use Apple's "Please enter a valid server host." on phone and TV together.

AI Disclosure

  • Harness: Claude Code (in T3 Code)
  • Tool(s): Claude Code; agent-device and adb on a temporary Android TV emulator
  • Model(s): claude-opus-5-5
  • Involvement: AI-assisted: the agent reproduced each state, moved the shared code, wrote the TV screen change, and ran the emulator checks
  • Adversarial review: the plan round was skipped because the change reuses the phone's existing, tested parsing and Apple TV's layout. A background adversarial review by gpt-6.1-sol of 831e5f6 found two issues, open in their threads: after an attempt that a server answers with an error, the field keeps the attempted URL with its port, so a new Port value is ignored (P2); and an explicit :0 port in the address is dropped instead of rejected, which the phone's helper already did (P3).

🤖 Generated with Claude Code

Note

Add Advanced options and validation errors to TV server address screen

  • The TV server setup screen replaces URL shortcut buttons with an Advanced options toggle offering Auto/HTTPS/HTTP scheme selection and a numeric port field
  • TV connection attempts use the selected scheme and port to build candidate URLs, show validation errors before probing, and keep the user's typed address when a probe fails; a final network failure now shows "Could not reach a Silo server at that address."
  • Address parsing, validation, candidate URL building, and cleartext detection move from the Android and TV view models into the shared common.network package in ServerSetupAddress.kt
  • The connect button now submits even a blank address when idle, so the view model can display its validation error
  • Behavioral Change: an address with an explicit port of 0 now fails port validation instead of being treated as having no address-supplied port (parseServerSetupInput in ServerSetupAddress.kt)

Macroscope summarized d88a5ec.

…nd errors

The Android TV address screen offered https://, http:// and .com typing
chips where Apple TV, Roku and the Android phone offer Advanced options:
a protocol (Auto, HTTPS, HTTP) and a port. It said "Network error. Check
the URL and try again." for both an unreachable address and a malformed
one, and did nothing on a blank Connect.

The phone's address parsing moves unchanged to android-shared, so both
apps build the same candidates (Auto tries HTTPS, then HTTP, then port
8090) and give the same errors: "Please enter a server host.", "Enter a
valid server address." and, as on Apple TV, "Could not reach a Silo
server at that address."

Part of #743

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

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

@coderabbitai

coderabbitai Bot commented Oct 31, 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 14 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 130 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: 6682f2ea-6809-49ba-9375-c9998ff2baf7
Commits

Reviewing files that changed from the base of the PR and between 76dee90 and d88a5ec.

Files selected for processing: 12
  • android-shared/src/androidMain/kotlin/org/siloserver/silo/common/network/ServerSetupAddress.kt
  • android-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/network/ServerSetupCandidateUrlsTest.kt
  • android-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/network/ServerSetupCleartextWarningTest.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/auth/ServerSetupScreen.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/auth/ServerSetupViewModel.kt
  • androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/auth/TvAuthInputRules.kt
  • androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/auth/TvServerSetupScreen.kt
  • androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/auth/TvServerSetupViewModel.kt
  • androidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/screens/auth/TvAuthInputRulesTest.kt
  • androidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/screens/auth/TvServerSetupCleartextWarningTest.kt
  • androidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/screens/auth/TvServerSetupPersistenceTest.kt
  • androidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/screens/auth/TvServerSetupUrlProbeTest.kt
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 31, 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-31T01:24:22.723729Z d88a5ec New commits
🔒 Security Review ✅ Completed 2026-10-31T01:25:37.955145Z d88a5ec New commits
ℹ️ 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 priority: P2 Limited scope, workaround exists, or polish labels Oct 31, 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 831e5f6)

Two findings: F1 concerns retrying after an answered-with-error probe; F2 concerns validation of an explicit port. Reviewed the pinned diff and affected call paths, and checked the relevant java.net.URI behavior. No device testing was performed for this review.

AI disclosure: model gpt-6.1-sol; harness Codex in T3 Code; AI-generated review.

A server that answered with an error put the tried URL, port included,
into the address field, so a new Port value was ignored on the next try.
The field now keeps what was typed. An explicit `:0` in the address was
dropped as "no port"; it is now rejected like any other invalid port.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@silo-triage silo-triage Bot added size/XL 500–999 added + deleted lines (all files); change volume, not priority. and removed size/L 200–499 added + deleted lines (all files); change volume, not priority. labels Oct 31, 2026
@silo-kody

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

@macroscopeapp

macroscopeapp Bot commented Oct 31, 2026

Copy link
Copy Markdown

Shared address validation changes what phone users see for an explicitly zero-valued port: it now shows a port validation error instead of dropping the port and trying a default endpoint. The Evidence section says Android TV only, so this phone change has no evidence. Please add before/after server-setup captures of that case for an Android phone, Android tablet, and Android foldable both folded and open.

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

Posted via Macroscope — Visible change evidence

@Quick104

Copy link
Copy Markdown
Contributor Author

Evidence updated: phone, tablet, foldable (folded/open) captures of the phone app rejecting an explicit :0 port.

@Quick104
Quick104 merged commit e9657ee into main Oct 31, 2026
8 of 10 checks passed
@Quick104
Quick104 deleted the fix/issue-743-tv-server-address branch October 31, 2026 19:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working priority: P2 Limited scope, workaround exists, or polish size/XL 500–999 added + deleted lines (all files); change volume, not priority.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant