Skip to content

fix(web): keep string selections as strings in plugin settings saves - #4179

Merged
Quick104 merged 7 commits into
mainfrom
fix/plugin-config-multiselect-string-types
Nov 14, 2026
Merged

Quick104 merged 7 commits into
mainfrom
fix/plugin-config-multiselect-string-types

Conversation

@Quick104

@Quick104 Quick104 commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Related issue: N/A
Validation tasks: none (reaches #1225 C1 and C2; first-party plugin saves are unchanged, see Validation)

Other clients: N/A (web admin only; no client shows plugin settings)

When an admin saves plugin settings in the web admin, a multi-select whose options are numeric-looking strings saves as numbers. Selecting "001" and "123" saves [1, 123]. That changes the value, and a plugin whose config schema declares a string array can reject it. The same happens on the Sign-in settings page. No first-party plugin has a multi-select in its global or connection settings, so this hits third-party plugins.

The plugin settings form and the Sign-in page built the saved entry without the schema's declared field types. Without them, buildSchemaValues falls back to a guess from the control, and for a multi-select that guess converts every all-digit string to a number. #4176, now merged, loads a saved multi-select list into the form as is, so on main even saving an untouched form re-sends a saved string list as numbers.

Approach

PluginConfigForm and stagedEntry now pass parseFieldTypes(json_schema) to buildSchemaValues for saves, connection tests, and draft reports, as the request-server and watch-provider forms already do. With a declared type, a field coerces by its schema. A field the schema doesn't type keeps the control-based guess. parseFieldTypes also reads an array's item type from a nullable type list (["integer", "null"]), a uniform enum, or a local #/$defs/ reference, so a numeric enum or $ref multi-select still saves numbers. An array whose item type it can't resolve (anyOf, a remote reference, no items) passes values through unchanged, as it already did for the forms that pass field types.

Validation

  • Two focused tests (the settings form's save and stagedEntry) fail on main with the reported coercion ([1, 123], [7]) and pass on this branch.
  • On top of fix(web): keep a saved multi-select value in plugin settings forms #4176 (main merged in), a boolean array keeps null items, so an untouched saved [null] no longer saves as [false]. Its test fails on the previous head.
  • The parseFieldTypes test covers numeric and string enum items, a nullable item type, and resolved and unresolved $ref items. It fails on main and on this PR's earlier heads.
  • Not reproduced live: no first-party plugin can produce the state on a dev deployment.
  • First-party plugins: a throwaway check (not committed) loaded the current manifests of all 17 first-party plugins and saved each field of their 28 config forms with sample values, with and without declared types. All 612 field/value pairs saved the same value, so plugin-management cases Plugin management / marketplace — Web admin #1225 C1 and C2 are unaffected.
  • Web lint, format check, build, bundle budget, and the local-path, case-collision, size-ratchet, and bidi checks pass.
  • make test-web: one unrelated failure, a CuratedTitlesEditor timeout under full-suite load. That test passed 3 of 3 runs on its own. No Go files changed.

Evidence

Evidence: https://evidence.siloserver.org/r/silo-server/plugin-config-multiselect-string-types/

Risks

A third-party plugin whose admin control disagrees with its declared type now saves what the schema declares. For example, a numeric control on a string property now saves a string, and a text control on an integer property saves a number. One case gets worse: a field the schema declares as an array of strings but shows as a text box now saves an empty list where it used to save the typed text. The plugin's schema would already reject that text, and request-server forms already behave this way. In this form, an array whose item type can't be resolved (anyOf, a remote reference) now saves strings where main guessed numbers. The forms that already pass field types gain only the nullable, enum, and local $ref item cases.

Checklist

  • I read and can explain the complete diff.
  • This pull request addresses one concern.
  • Each test this pull request adds meets "Decide what to test" in CONTRIBUTING.md.
  • The Evidence section shows every change a user can see, or how I checked a change nobody sees.

AI Disclosure

  • Harness: Claude Code in T3 Code
  • Tool(s): Claude Code, T3 Code
  • Model(s): claude-opus-5-5
  • Involvement: Fully AI-generated, human verified
  • Adversarial review: the code review ran at low level, one pass over the diff, with no findings. The plan round was skipped because the fix is mechanical: the source shows the root cause, and the fix passes declared types the same way existing callers do. The simplify pass found nothing to change. The background adversarial review (gpt-6.1-sol, Codex, reviewed bd90c64) found nothing new. Review found that arrays with enum, $ref, or nullable item schemas lost their item type; 4254bd9 through 04affdc resolve item types from nullable lists, enums, and local references (with JSON Pointer escapes decoded), 38c6f70 keeps null items in boolean arrays, and keep unresolved arrays as pass-through.

🤖 Generated with Claude Code

Note

Preserve string selections when saving plugin settings with schema types

  • Adds parseFieldTypes parsing of plugin JSON Schemas so buildSchemaValues coerces values according to declared field types. This keeps numeric-looking selections like "007" as strings when the schema declares string array items.
  • arrayItemType in schemaFormUtils.ts detects item types from nullable type lists, homogeneous enums, and local $defs/definitions references (with JSON Pointer escape decoding).
  • Applies the schema types in PluginConfigForm.tsx for draft staging, secret clearing, connection tests, and saves, and in the stagedEntry helper in signInSetup.ts.
  • Behavioral Change: null items in schema-declared boolean arrays now remain null instead of becoming false.

Macroscope summarized 38c6f70.

The plugin settings form and the Sign-in page built the saved entry
without the schema's declared field types, so buildSchemaValues fell
back to the control heuristic and turned numeric-looking multi-select
values such as "001" into numbers. Pass parseFieldTypes(json_schema),
as the request-server and watch-provider forms already do.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@silo-triage silo-triage Bot added the size/M 50–199 added + deleted lines (all files); change volume, not priority. label Nov 14, 2026
@coderabbitai

coderabbitai Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Walkthrough

Array item type inference now supports additional JSON Schema forms, including local references and homogeneous enums. Plugin configuration and sign-in staging pass parsed field types to value building.

Changes: Schema-aware configuration staging

Layer / File(s) Summary
Array item type inference
web/src/components/admin/plugins/schemaFormUtils.ts, web/src/components/admin/plugins/schemaFormUtils.test.ts
Array item types are inferred from scalar types, nullable type lists, homogeneous enums, and supported local references. Tests cover integer, nullable-integer, string-enum, and unresolved-reference cases.
Use parsed types when staging values
web/src/components/admin/plugins/PluginConfigForm.tsx, web/src/components/admin/plugins/PluginConfigForm.test.tsx, web/src/pages/admin-settings/signInSetup.ts, web/src/pages/admin-settings/signInSetup.test.ts
Plugin draft notifications, connection tests, and saves use values built with parsed field types. Sign-in staged entries also use parsed field types. Tests check that numeric-looking string selections remain strings.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: fluxis

Merge Risk: Low · up to 0f7ab

Numeric-looking strings in multi-select settings now stay strings when the schema declares string items. Two rare edge cases remain: a nullable boolean array item saved as false instead of null, and definition names containing "/" or "~" resolving to the wrong schema. Both are minor and can be fixed or accepted by the owner.

Security architecture risk: Minimal · up to 0f7ab

The change makes configuration values follow their declared schema types without introducing new endpoints or privileges. No introduced or worsened security, ownership or failure-containment risk was established in the inspected flows.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • observed — The affected values reach existing configuration and test requests for explicitly selected plugin installations, including sign-in providers. The impact is configuration serialization, not merely display formatting.

Security Findings and Attack Paths

  • observed — The new reference resolver accepts only same-document $defs or definitions references. It performs no external fetch or recursive reference traversal, so this addition does not create a schema-driven network request path.

Trust Boundaries and Controls

  • observed — The inspected mutation paths retain installation IDs and captured profile context, disable automatic mutation retries and authentication retries, and check profile authority after responses. The normal plugin mutation path also snapshots request bodies and checks authority before dispatch. These client controls are unchanged; server authorization was not independently assessed.
Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: string multi-select selections such as "001" are kept as strings in plugin settings saves. The changeset adds parseFieldTypes use in PluginConfigForm and stagedEntry, …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description check Passed The description is specific and on-topic. It names the bug (numeric-looking strings such as "001" and "123" saved as numbers in plugin settings and the Sign-in page), the affected files (PluginConfigF…
Full details: Title check

Explanation

The title names the main change: string multi-select selections such as "001" are kept as strings in plugin settings saves. The changeset adds parseFieldTypes use in PluginConfigForm and stagedEntry, plus array item type inference in schemaFormUtils.ts. The title's "fix(web)" prefix and "plugin settings" wording match the scope of the diff. The Sign-in settings page is also touched, but the title does not need to cover every detail.

Full details: Description check

Explanation

The description is specific and on-topic. It names the bug (numeric-looking strings such as "001" and "123" saved as numbers in plugin settings and the Sign-in page), the affected files (PluginConfigForm, stagedEntry, parseFieldTypes), the fix approach, validation, and risks. It matches the changeset in the raw summary, so the check passes.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@silo-kody

silo-kody Bot commented Nov 14, 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 Nov 14, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-14T21:27:13.835565Z 38c6f70 New commits
🔒 Security Review ✅ Completed 2026-11-14T21:29:46.169847Z 38c6f70 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 javascript Pull requests that update javascript code priority: P2 Limited scope, workaround exists, or polish labels Nov 14, 2026
parseFieldTypes typed every array property as "array", which passes
values through untouched. An array whose items carry no plain type
(enum, $ref, a nullable type list) then saved numeric selections as
strings, where the control heuristic used to make them numbers. Record
"array" only for string items and leave the rest untyped.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@silo-kody

silo-kody Bot commented Nov 14, 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 ❌
⚠️ 4 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:

  • Preserve optional store capabilities through production wrappers
  • Detach mandatory cleanup from request cancellation and bound its lifetime
  • Preserve durable media identity and share identity-evidence precedence
  • Bound decoder throughput trades and share direct-play eligibility

@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: 4254bd9043

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

The previous commit left arrays with no plain item type untyped, which
sent string enum and $ref items through the numeric control heuristic
and changed the request-server and watch-provider forms. Read the item
type from a nullable type list or a uniform enum instead, and keep any
other array as a plain pass-through array, as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@silo-kody

silo-kody Bot commented Nov 14, 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 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.

Actionable comments posted: 2

Review info

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: a0846b2b-8704-4a25-8276-9cef952b4b25
Commits

Reviewing files that changed from the base of the PR and between ae4be79 and 6d3d1b5.

Files selected for processing: 6

  • web/src/components/admin/plugins/PluginConfigForm.test.tsx
  • web/src/components/admin/plugins/PluginConfigForm.tsx
  • web/src/components/admin/plugins/schemaFormUtils.test.ts
  • web/src/components/admin/plugins/schemaFormUtils.ts
  • web/src/pages/admin-settings/signInSetup.test.ts
  • web/src/pages/admin-settings/signInSetup.ts

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

An array whose items are a local reference such as "#/$defs/id" typed
as a plain array, so the plugin settings form saved integer selections
as strings where main coerced them. Resolve one local $defs or
definitions reference before reading the item type.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@silo-kody

silo-kody Bot commented Nov 14, 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 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.

Actionable comments posted: 1

Review info

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: d9fdbd1e-c86f-48ca-849b-714c6d1286b4
Commits

Reviewing files that changed from the base of the PR and between 6d3d1b5 and 0f7aba0.

Files selected for processing: 2

  • web/src/components/admin/plugins/schemaFormUtils.test.ts
  • web/src/components/admin/plugins/schemaFormUtils.ts

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

A local reference such as "#/$defs/a~1b" names the definition "a/b".
Decode "~1" and "~0" before looking the name up.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@silo-kody

silo-kody Bot commented Nov 14, 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 and others added 2 commits November 14, 2026 16:24
Since #4176 a saved multi-select list loads into the form as is, so an
untouched nullable boolean list such as [null] reached coerceBoolean
and saved as [false]. Leave null items unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@silo-kody

silo-kody Bot commented Nov 14, 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
Quick104 merged commit e981d1b into main Nov 14, 2026
20 checks passed
@Quick104
Quick104 deleted the fix/plugin-config-multiselect-string-types branch November 14, 2026 21:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working javascript Pull requests that update javascript code 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.

1 participant