Skip to content

fix(connect): reject non-Prairie servers on manual URL entry - #119

Merged
JonahMMay merged 1 commit into
mainfrom
fix/manual-server-probe
Sep 30, 2026
Merged

JonahMMay merged 1 commit into
mainfrom
fix/manual-server-probe

Conversation

@JonahMMay

Copy link
Copy Markdown
Contributor

Problem

You could enter a non-Prairie address such as jellyfin.jonahmay.net on the Add server screen and still reach login. Both Quick Connect and password login then failed with a bare "Not found". ManualServerScreen never ran checkServer. It sent the typed URL straight to login. The saved-server and discovered-server paths already ran the check.

Changes

  • ManualServerScreen now checks the URL with buildManualUrlCandidates + checkServerCandidates before opening login. A bare host is tried as https first, then http. While it checks, the button reads "Checking…". A failed check or a server that isn't set up yet shows an error under the field.
  • checkServer:
    • Returns "That address is not a Prairie server. Check the URL and port." when both /api/v2/system/setup and /api/v1/auth/setup return 404 or 405.
    • Rejects a 200 response unless its body is a JSON object with a boolean needs_setup. This catches web servers that answer every path.
  • Tests: added test/api/check_server_test.dart (v2 success, v1 fallback, both routes 404, 200 without a setup payload).

Notes

  • The stricter response check also applies to saved and discovered servers. It assumes every Prairie server version includes needs_setup in its setup response.

Testing

  • flutter test in prairie_core: all 193 tests pass. flutter analyze is clean on the changed files.
  • Not tried on a TV yet.

🤖 Generated with Claude Code

The manual "Add server" screen skipped checkServer and routed straight
to login, so any address (e.g. a Jellyfin host) reached Quick Connect
and password login, which then failed with a bare "Not found".

- Probe manual URLs with checkServerCandidates before opening login,
  surfacing failures and needs-setup inline.
- checkServer now reports "not a Prairie server" when both setup
  routes are missing, and rejects 200 responses without a boolean
  needs_setup field.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Sep 30, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 5 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 499dc1b1-7884-4580-88a3-6003c3490648

📥 Commits

Reviewing files that changed from the base of the PR and between 68775ef and 801b453.

📒 Files selected for processing (3)
  • flutter/packages/prairie_core/lib/src/api/check_server.dart
  • flutter/packages/prairie_core/lib/src/screens/manual_server_screen.dart
  • flutter/packages/prairie_core/test/api/check_server_test.dart
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@JonahMMay
JonahMMay merged commit cd1acbd into main Sep 30, 2026
7 checks passed
@JonahMMay
JonahMMay deleted the fix/manual-server-probe branch September 30, 2026 20:59
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