Skip to content

feat(profiles): set whether a new profile may make requests - #820

Merged
Quick104 merged 2 commits into
Silo-Server:mainfrom
Rhainland:feat/811-profile-requests-allowed
Oct 24, 2026
Merged

Quick104 merged 2 commits into
Silo-Server:mainfrom
Rhainland:feat/811-profile-requests-allowed

Conversation

@Rhainland

@Rhainland Rhainland commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Closes #811
Related issue: Silo-Server/silo-server#1430
Validation tasks: none affected

The server can now block one profile from media requests (Silo-Server/silo-server#2612), but the Apple apps give a household manager no way to set it when they create a profile. A Child Profile made in the app keeps requests, so the child can browse titles outside the library, where parental controls only partly apply. This change adds an Allow requests switch to the new-profile form, and Child Profile turns it off, matching the web Kids preset.

Approach

  • The form reads the household profile list and shows the switch only when the server reports requests_allowed_supported. Older servers never see the field. Only a blocked profile sends requests_allowed: false, because the server's default is allowed.
  • If that read fails, the form checks again when you tap Create Profile. If it still fails, it shows an error instead of creating a Child Profile with requests allowed.
  • Turning on Child Profile switches requests off unless the manager has already changed the switch. Turning Child Profile off resets it, the same way the preset resets its rating and library limits.
  • A blocked profile already loses its request entry points: getRequestStatus reports allowed: false, and the app gates on it. No other screen changes.
  • The Apple apps still can't edit an existing profile, so changing the switch later needs the web app.

Validation

  • Unit tests: the profile v2 suite passes on iOS and tvOS (21 tests each). The new tests cover decoding requests_allowed and the support flag, and leaving the field out on older servers.
  • Builds: Silo, SiloTV and SiloMac build.
  • Manual on the iPhone simulator against a local server:
    • The form shows the switch, and Child Profile turns it off.
    • The created profile is stored as blocked and has no Requests entry or request section in search; the primary profile keeps both.
  • Not driven by hand: the tvOS form and the Mac app (build only).
  • Tests ran before the rebase onto current main, which applied without conflicts.

Evidence

Evidence: https://evidence.siloserver.org/r/silo-apple/pr-820/

Surface and build: iPhone (iOS 26.5 simulator); before is main (5c9959a), after is this branch. iPad uses the same form layout and wasn't captured separately. Apple TV and Mac weren't captured because I couldn't drive their simulators in this session; both build.

Risks

  • Needs the server change for the switch to appear; without it, nothing changes.
  • New Child Profiles created in the app start with requests off.

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; Codex CLI for one of the two reviews
  • Model(s): claude-opus-5-5; gpt-6.1-sol (review)
  • Involvement: Fully AI-generated, human verified
  • Adversarial review: two independent reviews (claude-opus-5-5 and gpt-6.1-sol) of the full diff, and again of the follow-up changes.
    • Fixed: a failed support check let a Child Profile be created with requests allowed.
    • Dropped: an onboarding-tour guard in the app, which could send an allowed profile Home. The server now leaves the Requests step out of the tour for blocked profiles.

Note

Add per-profile requests-allowed setting to profile creation

  • Adds an optional requests setting to the profile-create payload and to SiloAPI.createProfile / AuthService.createProfile. A nil value omits the member from the JSON body.
  • Adds a householdProfileList operation that decodes a new profile-list envelope and reports whether the server supports the per-profile requests setting; the flag is only true when the server sends exactly true.
  • The new-profile form in CreateProfileView.swift shows the requests switch only when the server reports support, defaults child profiles to blocked requests, and tracks manual switch changes so presets do not overwrite them. Submit blocks with a form error if support cannot be confirmed, and retries the capability read once.
  • Generalizes the tvOS child-profile row into a reusable ProfileSwitchRow component with title, subtitle, and accessibility labels.
  • Behavioral Change: APIv2Client.householdProfiles still returns only the profile rows; callers needing the capability flag must use householdProfileList. Old servers that omit the requests member keep decoding with a nil value.

Macroscope summarized 2267742.

The new-profile form offers Allow requests when the server reports requests_allowed_supported, and the Child Profile preset turns it off.
@silo-triage silo-triage Bot added the size/L 200–499 added + deleted lines (all files); change volume, not priority. label Oct 16, 2026
@silo-kody

silo-kody Bot commented Oct 16, 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 16, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

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 55 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: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d109feb7-fad7-4f28-b6df-a343c3f0d68e
📥 Commits

Reviewing files that changed from the base of the PR and between ae1f94d and 2267742.

📒 Files selected for processing: 1
  • iosApp/iosApp/Screens/Profiles/CreateProfileView.swift

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 431b7a8d-ac57-44ed-b5cb-bc8182dee6ca
📥 Commits

Reviewing files that changed from the base of the PR and between 5c9959a and ae1f94d.

📒 Files selected for processing: 7
  • iosApp/Tests/ProfilesV2Tests.swift
  • iosApp/iosApp/Networking/APIv2/APIv2Client.swift
  • iosApp/iosApp/Networking/APIv2/APIv2Models.swift
  • iosApp/iosApp/Networking/SiloAPI.swift
  • iosApp/iosApp/Networking/WireFormatModels.swift
  • iosApp/iosApp/Screens/Auth/AuthService.swift
  • iosApp/iosApp/Screens/Profiles/CreateProfileView.swift

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

📝 Walkthrough

Profile creation now reads whether the server supports requests_allowed. The form shows and sends the setting when supported, with defaults tied to the Child Profile switch.

Changes: Profile Request Controls

Layer / File(s) Summary
Profile capability and create API
iosApp/iosApp/Networking/APIv2/APIv2Models.swift, iosApp/iosApp/Networking/WireFormatModels.swift, iosApp/iosApp/Networking/APIv2/APIv2Client.swift, iosApp/iosApp/Networking/SiloAPI.swift
The API models decode the profile setting and server support metadata. The client returns profiles with the support flag and includes the optional setting in profile creation.
Profile creation form behavior
iosApp/iosApp/Screens/Profiles/CreateProfileView.swift, iosApp/iosApp/Screens/Auth/AuthService.swift
The form checks server support, shows the setting on iOS and tvOS when supported, and applies defaults based on the Child Profile switch. AuthService forwards the optional setting.
Profile API tests
iosApp/Tests/ProfilesV2Tests.swift
Tests cover support metadata, optional profile decoding, and omission or transmission of requests_allowed in profile creation.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Feature · Severity of issue fixed: Medium

Sequence Diagram(s)

sequenceDiagram
  participant CreateProfileView
  participant AuthService
  participant SiloAPI
  participant APIv2Client
  participant Server
  CreateProfileView->>SiloAPI: Read household profile list
  SiloAPI->>APIv2Client: Request profile list
  APIv2Client->>Server: GET /api/v2/profiles
  Server-->>APIv2Client: Profiles and requests_allowed_supported
  APIv2Client-->>CreateProfileView: Profiles and support flag
  CreateProfileView->>AuthService: Create profile with optional requestsAllowed
  AuthService->>SiloAPI: Forward profile settings
  SiloAPI->>APIv2Client: Create profile request
  APIv2Client->>Server: POST profile with optional requests_allowed
Loading

Suggested reviewers: quick104

Merge Risk: ⚪ Minimal · up to ae1f9

The new Allow requests switch appears only when the server supports it, and the form is unchanged otherwise. No merge-blocking risk was identified in the supplied change.

Pre-merge checks: Passed 3 · Failed 2

Failed Failed checks: 2 warnings

Check name Status Explanation Resolution
Linked Issues check Warning Issue #811 requirements for profile creation are implemented. The form reads requests_allowed_supported, hides the switch unless support is true, sends requests_allowed: false only for blocked pro… Add the RequestsFeatureStore.isEnabled guard to the onboarding Requests route and add automated tests that verify the route opens only when the capability is enabled. If the server-side omission is intended to replace this requirement, up…
Docstring Coverage Warning Docstring coverage is 27.78% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 18 functions across 7 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 3 passed
Check name Status Explanation
Out of Scope Changes check Passed The changed API models, profile-list capability plumbing, create-profile payload, form state, platform layouts, switch-row refactor, and tests support issue #811. No unrelated change is demonstrated b…
Description check Passed The description clearly explains the new Allow requests switch, server capability handling, child-profile behavior, validation, and risks. It is directly related to the changeset.
Title check Passed The title clearly and concisely summarizes the primary change: allowing the app to set whether a new profile may make requests.
Full details: Out of Scope Changes check

Explanation

The changed API models, profile-list capability plumbing, create-profile payload, form state, platform layouts, switch-row refactor, and tests support issue #811. No unrelated change is demonstrated by the reviewed diff.

Full details: Linked Issues check

Explanation

Issue #811 requirements for profile creation are implemented. The form reads requests_allowed_supported, hides the switch unless support is true, sends requests_allowed: false only for blocked profiles, retries an unknown capability before creation, and applies the Child Profile preset rules. Tests cover capability decoding, profile decoding, and request payload omission. The onboarding requirement is not implemented in this app change. OnboardingTourView still allows /requests in supportedRoutes and apply(route:) navigates to router.navigate(to: .requestsHub) without checking RequestsFeatureStore.isEnabled. The PR description's claim about a server-side omission is not evidence of the required client-side guard in this repository.

Resolution

Add the RequestsFeatureStore.isEnabled guard to the onboarding Requests route and add automated tests that verify the route opens only when the capability is enabled. If the server-side omission is intended to replace this requirement, update or close the directly linked issue before reassessment.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@silo-triage silo-triage Bot added enhancement New feature or request impact: security Auth, privacy, or permission boundary needs-review Needs maintainer review to resolve uncertain classification, scope, or changed evidence. priority: P2 Limited scope, workaround exists, or polish labels Oct 16, 2026
@macroscopeapp

macroscopeapp Bot commented Oct 16, 2026

Copy link
Copy Markdown

The new-profile “Allow requests” switch and its interaction with “Child Profile” are not evidenced on iPhone Duo (folded and open) or iPad. Please add before-and-after captures of the same form on those devices and a short recording of the preset interaction. The PR explains that Mac and Apple TV captures were unavailable; the evidence link is treated as evidence for the iPhone, but the linked page should also be checked for the listed device coverage.

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

Posted via Macroscope — Visible change evidence

@silo-kody

silo-kody Bot commented Oct 17, 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 ❌
⚠️ 3 Kody Rule(s) were not evaluated

These rules declare that they need repository context beyond this diff, and the review could not retrieve it, so they were not judged on this pull request:

  • Centralize server-relative authentication path validation
  • Enforce latest-link-wins centrally across deferred deep links
  • Rank subtitles using container capabilities and one stable cross-client policy

@Quick104
Quick104 merged commit bf23f9e into Silo-Server:main Oct 24, 2026
8 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request impact: security Auth, privacy, or permission boundary needs-review Needs maintainer review to resolve uncertain classification, scope, or changed evidence. priority: P2 Limited scope, workaround exists, or polish size/L 200–499 added + deleted lines (all files); change volume, not priority.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[feature] Let a household manager block a profile from requests

2 participants