Skip to content

feat(plugins): let a screen gate a user setting on administrator configuration - #3085

Closed
Pasithea0 wants to merge 16 commits into
Silo-Server:mainfrom
Pasithea0:feat/plugin-report-settings
Closed

Pasithea0 wants to merge 16 commits into
Silo-Server:mainfrom
Pasithea0:feat/plugin-report-settings

Conversation

@Pasithea0

@Pasithea0 Pasithea0 commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Related issue: N/A
Validation tasks: none

A plugin can declare per-account settings and the host stores them, but nothing
tells a screen whether an operator has configured the plugin at all. A user-facing
toggle whose feature depends on administrator configuration therefore cannot be
offered honestly: it can only be drawn and then fail after the viewer has asked for
it.

The concrete case is TheIntroDB's report control. Reporting an incorrect segment
needs the server's TheIntroDB key, so without that key there is nothing to report
with and the control should not be offered. This change makes that knowable, and
adds the control that consumes it.

Approach

The user-facing plugin settings response gains configured_global_keys: which global
config entries an installation has set. The store reads config keys, and decodes an entry
only to judge whether it carries anything; no value is ever returned, so a credential an
administrator entered cannot reach a browser through this path. A read failure reports
none rather than failing the request, because a screen must not claim a server can report
when it cannot prove it.

The report itself goes browser to Silo to the plugin, never browser to TheIntroDB:
the key is one shared secret and handing it to every viewer's tab is not a trade
worth making. The plugin holds it already, so it serves a route, and the control
calls that with a short-lived plugin access cookie rather than the app's token.

Per-account values are keyed by schema entry rather than by field, with each entry's
value a JSON string. One helper pair owns that layout so a reader and a writer
cannot disagree about it.

Touches the web app and the plugin host. The plugin-side route is
Silo-Server/silo-plugin-markers-theintrodb#13.

Validation

Rebased onto main at b6b7dd38f; the branch had been 325 commits behind, so everything
below ran against the merge base this pull request actually has.

  • Web: typecheck, lint (0 errors), format:check, the production build and its bundle
    budget pass, and the suites covering what this changes pass (the report control, its
    setting, the gate hook, the two helpers and their neighbours: 54 tests over 6 files).
  • Go: ci / Go test and ci / Go DB pins cover the changed packages, including the new
    database-backed tests that the key listing returns names and not values, that a cleared
    entry is not named, and that one unreadable entry is isolated to its installation. Those
    tests need PostgreSQL and libvips, which the environment this revision was assembled in
    does not have, so the Go side is CI's result rather than a local claim.
  • Contracts: settings bindings, the v2 OpenAPI artifact and its regenerated fixtures
    (regenerating web/src/api/v2/schema.ts from the committed OpenAPI document is a
    no-op), the pre-lock contract diff, playback fixtures and the v1 route freeze all pass.
  • The route chain was exercised against a running server: deliberately invalid bodies
    came back as the plugin's own validation errors relayed through Silo, and nothing was
    written upstream.

Evidence

Before After
Screenshot 2026-10-25 at 4 04 24 PM Screenshot 2026-10-25 at 3 58 58 PMScreenshot 2026-10-25 at 4 02 39 PM

Surface and build: the Playback settings page's TheIntroDB section, and the report
control under the skip prompt, on this branch.

Captures for both surfaces are being added; the change is visible, so this section
is incomplete until they are here.

Risks

configured_global_keys names every stored config entry that holds a value, including
one a plugin wrote outside its declared global schema. Values are never included, so the
exposure is the names of configuration entries rather than their contents, and an entry
left empty by a clear is not named at all.

Reports are sent with the server's key, so a flag is attributed to the server rather
than to the viewer who raised it. That is deliberate: the alternative is a shared
secret in every viewer's browser, or asking each viewer for an account they may use
once.

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 says there is none.

AI Disclosure

  • Harness: Hermes Agent
  • Tool(s): Hermes Agent
  • Model(s): deepseek-ai/DeepSeek-V4.1-Flash (served by DeepInfra)
  • Involvement: Fully AI-generated, human verified
  • Adversarial review: the combined change was reviewed by a separate agent with no
    hand in writing it, which read the diff end to end and ran the repo's own gates as
    evidence rather than trusting the author's summary. Scope: whether any response
    reachable without admin rights exposes a secret, API contract discipline, the
    0-versus-unrated distinction, React hook ordering, test quality against "Decide what
    to test", and comment style. Findings bearing on this pull request, all resolved: the
    per-account switch did nothing, because the installation id was handed to the player
    whenever the plugin was available and the viewer's stored setting was read nowhere,
    so the control drew itself for viewers who had turned it off; the gate was derived
    independently in the player and in the settings screen, and is now one hook; a
    hand-maintained settings document had been reformatted across roughly four hundred
    untouched lines, and the semantic change is now the only difference; an exported
    helper was dead code with a test pinning it, and both are gone; the report control
    could name the wrong segment in its tooltip, and now takes the segment per prompt.
    The unfiltered key listing was reported as low severity and is kept, disclosed above.

Response to review

Both automated reviewers ran against the first revision, and both found the same defect
independently. Where they stand:

  • A partial write could delete the account's other plugin settings (Kody and
    CodeRabbit, major). Real, and fixed: the PUT replaces the whole stored set, and the
    switch merged onto whatever the values query had. While that query was pending, or
    after it failed, there was nothing to merge onto, so a write sent the report entry
    alone. The switch now stays off until the current values are in hand, explains itself
    when the read failed, and a test pins both.

  • A report could be sent under a previously signed-in profile (Kody, security). Real,
    and fixed: the launch cookie is bound to the profile that asked for it, and the
    module-level timestamp outlived a profile switch. The timestamp is gone and each report
    mints its own launch, which re-reads whoever is signed in at that moment. The test that
    pinned the reuse now pins the mint.

  • configured_global_keys reported row presence, not a usable key (Kody). Valid,
    and fixed after a real server hit it: an operator cleared the key from the admin side
    and the toggle stayed live with nothing behind it. A cleared entry keeps its row and
    holds an empty object, and the check read the row. The store now names only entries
    that carry something, decoding values to judge emptiness and never returning them, so
    the keys-only property above still holds. Confirmed against that database: the cleared
    entry decodes to an empty object and is now excluded, and tests cover the empty object,
    the empty string and the blank string.

  • The base of the write could revert another tab's change (CodeRabbit, major). Real,
    and fixed: the base of a replace-all write was the copy this screen had read, which the
    query may have held for 30 seconds, so a change another tab stored in between was sent
    back to its old value. The contract carries no version to compare against and no
    per-entry write, so the write now re-reads the installation (staleTime: 0) and merges
    the one field into the one entry before sending it, which narrows the window to one
    round trip; a failed re-read writes nothing rather than an empty base. Tests pin that
    the write carries what the second read found, and that a failed read sends no write.

  • The report control was drawn under ranges TheIntroDB never served (Kody). Valid, and
    fixed: a report contests a range the provider published, and the control sat under any
    skip prompt — including ranges Silo's own scanner detected, a person edited, or another
    provider supplied. The marker on screen is now the gate's input, and only a range whose
    provenance names TheIntroDB offers the control. A range with no recorded provenance does
    not either: not attributable is the safe answer for a write against a shared database.

  • Both areas this change adds files to were converted to the message catalog (new,
    found while rebasing). src/components/settings/** and src/player/components/** take
    their text from the shared catalog now, and the lint rejects literals there, so the
    report control's strings had to move: feat(web): add the strings for reporting an incorrect segment silo-translations#27 adds the 18
    web-only keys, and this branch converts the two files. That catalog change needs the
    maintainer's translation pass and the release its merge publishes, so until then the pin
    is generated from it locally (local-56f90300dc5c); scripts/sync-translations --version <release> moves the pin, and the only difference is the pin plus the languages
    that gain the keys.

  • A plugin route's provider block was flattened into a 502 (CodeRabbit, raised on
    feat: report an incorrect segment using the server's configured key silo-plugin-markers-theintrodb#14, fixed here). The proxy answered every
    failure of a plugin route with 502 plugin route failed, so the typed retry contract the
    plugin reports a provider-wide block through — the same one the marker lookup path
    records its cooldown from — died at the proxy and the viewer saw a broken report. A
    ResourceExhausted now answers 429 with Retry-After carrying the delay the provider
    asked for (and no header when it asked for none), and the report call reads it and says
    when to come back. Tests cover the relayed delay, a sub-second delay, a block without
    one, two non-retryable failures and the two client messages. The lookup path's shared
    cooldown is unchanged: it belongs to provider health, not to this proxy.

  • Evidence is incomplete (Macroscope). True, and the only thing still outstanding. A
    recording of the confirmation flow is included in what is being attached.

Note

Add viewer reporting of TheIntroDB intro markers, gated on server and user settings

  • Lets a screen gate the per-user show_report plugin setting on whether the administrator has configured the plugin's global account key. The playback settings page renders a TheIntroDbReportSettings switch that is disabled with an explanatory message when the key is absent (TheIntroDbReportSettings.tsx).
  • The server exposes configured global key names (not values) on plugin settings responses via a new configured_global_keys field, populated by ListConfiguredGlobalConfigKeysForInstallations which only counts entries carrying real values (empty objects and blank strings are unset) (http_proxy.go, runtime_config.go).
  • Adds an in-player report control: VideoPlayer renders MarkerReportButton below an active intro/skip prompt when the marker's provenance is TheIntroDB. Reporting mints plugin access through the plugin-launch endpoint, then POSTs to the plugin's content report route.
  • Plugin route proxy now maps ResourceExhausted gRPC errors to 429 with a rounded-up Retry-After from RetryInfo; other errors still return 502.
  • Behavioral Change: v2 plugin settings responses gain a required configured_global_keys array (v1 JSON omits it); unreadable encrypted config entries exclude only their own installation's keys rather than failing the batch.

Macroscope summarized 511e8b9.

@silo-triage silo-triage Bot added the size/XXL 1000–2999 added + deleted lines (all files); change volume, not priority. label Oct 25, 2026
@silo-kody

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

Copy link
Copy Markdown

The PR changes user-visible settings and playback UI, but the Evidence section has no captures yet. Please add:

  • web/src/pages/settings/PlaybackSettings.tsx and web/src/components/settings/TheIntroDbReportSettings.tsx: before-and-after screenshots of the Playback settings page showing the provenance switches and TheIntroDB report setting, on desktop and mobile web, with the surface and build or commit identified.
  • web/src/player/components/IntroSkipButton.tsx, web/src/player/components/MarkerReportButton.tsx, and web/src/player/components/VideoPlayer.tsx: before-and-after captures of the skip prompt showing marker provenance and the Report control, plus a short recording of the report confirmation flow; cover desktop and mobile web where visible and identify the surface and build or commit.

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

Posted via Macroscope — Visible change evidence

@coderabbitai

coderabbitai Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • Resume reviews
  • Trigger review
Walkthrough

The API now reports configured plugin global-key names without values. The settings page gates TheIntroDB report controls on server configuration and viewer opt-in. Playback prompts can submit marker reports for supported content IDs.

Changes: TheIntroDB marker reporting

Layer / File(s) Summary
Expose configured plugin global keys
internal/plugins/runtime_config.go, internal/api/handlers/plugins.go, internal/apiv2/settings.go, contracts/api/v2/openapi.json, web/src/api/v2/schema.ts, contracts/api/v2/fixtures/*, internal/plugins/runtime_config_keys_test.go, internal/api/handlers/plugins_v1_wire_test.go, scripts/ci/db-contracts.txt, web/src/components/AppSidebar.test.tsx
The runtime config store lists keys with usable values. Plugin settings responses expose the key names without values, and schemas and fixtures include a non-null configured_global_keys array. The v1 wire test checks that the field remains absent from the v1 response.
Gate and configure report settings
web/src/lib/pluginEntryValues.ts, web/src/hooks/queries/pluginSettings.ts, web/src/hooks/queries/markerReportSettings.ts, web/src/components/settings/TheIntroDbReportSettings.tsx, web/src/pages/settings/PlaybackSettings.tsx, web/src/hooks/queries/markerReportSettings.test.ts, web/src/lib/pluginEntryValues.test.ts, web/src/hooks/queries/pluginSettings.test.ts, web/src/components/settings/TheIntroDbReportSettings.test.tsx, web/src/pages/settings/PlaybackSettings.test.tsx, web/src/locales/*, web/src/locales/keys.ts, .silo-translations
Settings hooks read and update plugin values. The report gate checks the installation, declared report entry, and configured account key. Playback settings show the report toggle and disable it when required configuration or loaded settings are unavailable. Locale files add reporting and settings messages.
Submit reports from player prompts
web/src/lib/markerReport.ts, web/src/lib/markerProvenance.ts, web/src/player/components/MarkerReportButton.tsx, web/src/player/components/IntroSkipButton.tsx, web/src/player/components/VideoPlayer.tsx, web/src/player/components/WatchPage.tsx, web/src/lib/markerReport.test.ts, web/src/lib/markerProvenance.test.ts, web/src/player/components/WatchPage.trickplay.test.ts
The player passes the enabled installation and content ID to report controls under marker prompts. The report flow parses supported targets, obtains plugin access, submits the target, and presents the result.

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

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  actor Viewer
  participant MarkerReportButton
  participant reportMarkerSegment
  participant V2RequestClient
  participant PluginContentRoute
  Viewer->>MarkerReportButton: Confirm report
  MarkerReportButton->>reportMarkerSegment: Submit installation ID and parsed target
  reportMarkerSegment->>V2RequestClient: Request plugin launch access
  V2RequestClient-->>reportMarkerSegment: Return launch response
  reportMarkerSegment->>V2RequestClient: POST report target with credentials
  V2RequestClient->>PluginContentRoute: Send report request
  PluginContentRoute-->>V2RequestClient: Return report response
  V2RequestClient-->>reportMarkerSegment: Return response
  reportMarkerSegment-->>MarkerReportButton: Return report result
  MarkerReportButton-->>Viewer: Show report status or error
Loading

Suggested labels: api-v2, needs-review, priority: P3, impact: playback, impact: usability, evidence-required, impact: compat

Suggested reviewers: quick104

Merge Risk: Moderate · previous review 143f0

Toggling the TheIntroDB report setting rewrites the account's plugin settings from a read taken just before the write. A concurrent change from another tab, or an account switch in between, can overwrite stored values. A report can also be aimed at the new episode while the old one is still playing. These should be fixed or explicitly accepted before merge.

Security architecture risk: Minimal · up to 143f0

The inspected changes preserve the separation between administrator credentials and viewer preferences. Reporting requires an explicit confirmation, and the browser receives configuration-key names rather than credential values. No introduced security-boundary failure was established. The companion plugin’s reporting enforcement still needs separate verification.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The intended sensitive outcome is a community-database report attributed to the selected installation’s operator-owned TheIntroDB credential. The inspected browser request contains media identifiers, not that credential. Effective anonymous or authenticated reachability depends on the unavailable companion route policy and implementation.

Trust Boundaries and Controls

  • observed — Each report first requests a fresh plugin launch cookie. Issuance requires an access token with a login session; the cookie is five-minute, HttpOnly, SameSite=Lax, path-scoped to plugin content, and Secure on HTTPS. Proxy resolution checks current session authority and supplies resolved user, role and profile identity to the plugin. The configured-key and opt-in gates remain client presentation controls.

Resilience and Maintainability Implications

  • observed — Settings reads and writes use the authenticated user ID and an installation-specific namespace, so profiles within one account intentionally share this preference. Reporting requires confirmation, disables the control while sending, and displays terminal success, duplicate, authorization or rejection outcomes. The client does not automatically retry the external write; server-side duplicate enforcement was not verified.
Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: a screen can gate a user setting on administrator plugin configuration. The changeset adds the configured_global_keys field, the server-side key listing, and the repor…
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 related to the changeset. It states the problem (plugin settings cannot show whether an operator configured a plugin), describes the approach (the configured_global_keys field, the …
Full details: Title check

Explanation

The title names the main change: a screen can gate a user setting on administrator plugin configuration. The changeset adds the configured_global_keys field, the server-side key listing, and the report control gated on that state. The title is specific and matches the primary purpose, so it passes.

Full details: Description check

Explanation

The description is related to the changeset. It states the problem (plugin settings cannot show whether an operator configured a plugin), describes the approach (the configured_global_keys field, the report route through Silo, the per-entry JSON helpers), lists validation, and names risks. These match the changed files, including the Go store, API contract, web gate hooks, and the TheIntroDB report control. The Evidence section is incomplete, but that does not make the description off-topic.

Finishing Touches

Generate unit tests (beta)

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

@silo-triage silo-triage Bot added enhancement New feature or request go Pull requests that update go code javascript Pull requests that update javascript code priority: P2 Limited scope, workaround exists, or polish stacked Base is another open PR; merge in stack order named in the body labels Oct 25, 2026
<Switch
id={id}
checked={showReport}
disabled={!gate.serverConfigured || update.isPending}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

kody code-review Bug critical

Plugin settings loss occurs when the switch permits a replacement write while account values are loading or after a read failure: updatePluginEntryObject(undefined, ...) sends only the report entry, erasing all other stored plugin settings. Disable writes until the values query succeeds, including after an initial read error.

Prompt for LLM

File web/src/components/settings/TheIntroDbReportSettings.tsx:

Line 63:

Plugin settings loss occurs when the switch permits a replacement write while account values are loading or after a read failure: updatePluginEntryObject(undefined, ...) sends only the report entry, erasing all other stored plugin settings. Disable writes until the values query succeeds, including after an initial read error.

Talk to Kody by mentioning @kody

Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.

​

​

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.

Fixed in 7a603bb59, and kept through the rebase: the switch is only enabled once the values query has succeeded and a map is in hand (loaded = settings.isSuccess && values !== undefined), and setShowReport returns early otherwise, so a write can no longer be built from an unknown set. After a failed read the row says why it is off rather than silently doing nothing.

The write no longer merges onto this screen's copy of the values at all — see the answer on the same finding from CodeRabbit below: the write re-reads the stored set and merges onto that. TheIntroDbReportSettings.test.tsx pins both halves ("will not write until the account's current values are known", "says why it cannot be used when the values could not be read").

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The described fix addresses the original finding: the switch cannot write until the account settings have loaded successfully, and a failed read leaves it disabled with an explanation. Re-reading and merging the stored set before writing also reduces the risk of overwriting other settings.

I have not independently verified the implementation or tests.

declaresReport: (installation?.user_config_schema ?? []).some(
(entry) => entry.key === REPORT_SETTING_KEY,
),
serverConfigured: (installation?.configured_global_keys ?? []).includes(ACCOUNT_GLOBAL_KEY),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

kody code-review Bug high

Incorrect credential-readiness detection in serverConfigured enables the setting and report button without a reporting credential because it treats account configuration row presence as proof of an API key, although PutGlobalConfig and CompareAndSwapGlobalConfig persist empty objects and clearing the credential preserves the row. Expose a server-derived credential-readiness flag instead of inferring readiness from row presence.

Prompt for LLM

File web/src/hooks/queries/markerReportSettings.ts:

Line 42:

Incorrect credential-readiness detection in serverConfigured enables the setting and report button without a reporting credential because it treats account configuration row presence as proof of an API key, although PutGlobalConfig and CompareAndSwapGlobalConfig persist empty objects and clearing the credential preserves the row. Expose a server-derived credential-readiness flag instead of inferring readiness from row presence.

Talk to Kody by mentioning @kody

Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.

​

​

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.

Fixed, and the fix is on the server side where the fact lives: 4c706c02b. configured_global_keys no longer means "a row exists" — RuntimeConfigStore.ListConfiguredGlobalConfigKeysForInstallations decodes each entry and names it only when it carries something (runtimeConfigCarriesValue: a non-blank string, a non-empty container, or a number/boolean). A cleared credential keeps its row and holds an empty object, which is no longer counted. Values are decoded only to judge emptiness and are never returned, so the keys-only property of this field still holds.

For this plugin the inference is exact rather than a guess at row presence: the TheIntroDB account entry declares one property (api_key, additionalProperties: false), so "the entry carries something" is "the key is set". The three database-backed tests registered in scripts/ci/db-contracts.txt cover the filled-in entry, the empty object and the blank string.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Thanks for the explanation. Filtering out cleared entries on the server addresses the original row-presence issue without returning configuration values.

One qualification: a non-empty object is not necessarily a usable credential. For example, {"api_key": ""} would still count if the helper checks only whether the container is empty. The inference is exact only if the write path guarantees that an unset or blank api_key is stored as an empty object. It would be worth confirming that invariant or adding a test for it.

Comment thread web/src/lib/markerReport.ts Outdated

/** Mint the plugin access cookie when the remembered one is stale or absent. */
async function ensurePluginAccess(): Promise<boolean> {
if (launchedAt > 0 && Date.now() - launchedAt < LAUNCH_TTL_MS) return true;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

kody code-review Security critical

Cross-profile authorization occurs because the module-global launch timestamp reuses a profile-bound plugin cookie after a profile switch, and plugin authentication reads ProfileID directly from that cookie, allowing reports to execute under the previous profile's authority. Bind launch reuse to the current session/profile identity and remint whenever that identity changes, as the existing buildPluginHref flow does.

Prompt for LLM

File web/src/lib/markerReport.ts:

Line 110:

Cross-profile authorization occurs because the module-global launch timestamp reuses a profile-bound plugin cookie after a profile switch, and plugin authentication reads ProfileID directly from that cookie, allowing reports to execute under the previous profile's authority. Bind launch reuse to the current session/profile identity and remint whenever that identity changes, as the existing buildPluginHref flow does.

Talk to Kody by mentioning @kody

Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.

​

​

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.

Fixed in 282daa501, and carried through the rebase: nothing is remembered to reuse. Each report mints its own launch (mintPluginAccess calls POST /api/v2/auth/plugin-launch per report), so the cookie belongs to whoever is signed in at the moment the report is sent, and a profile switch elsewhere in the app cannot leave a report running under the earlier profile's authority. The module-level timestamp is gone; markerReport.test.ts pins the mint.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Thanks for addressing this. Minting plugin access for each report removes the module-level cookie reuse that caused the cross-profile issue, and the test helps guard against its return.

I haven’t independently verified the rebased code.

@coderabbitai coderabbitai Bot added api-v2 API v2 / Huma migration program (epic #135); long-running, stacked by phase evidence-required Needs before-and-after evidence before the Evidence check passes impact: playback Can't play, stalls, or wrong media impact: usability Core flow broken or severely blocked needs-review Needs maintainer review to resolve uncertain classification, scope, or changed evidence. priority: P3 Needs-info or parked labels Oct 25, 2026

@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: 0d26b1cb-92a4-445b-83e1-693796d5dae7
Commits

Reviewing files that changed from the base of the PR and between 6de6d5e and da71809.

Files selected for processing: 41
  • contracts/api/v2/breaking-approvals.json
  • contracts/api/v2/fixtures/get_plugin_settings_ok.json
  • contracts/api/v2/fixtures/list_plugin_settings_ok.json
  • contracts/api/v2/fixtures/update_plugin_settings_ok.json
  • contracts/api/v2/openapi.json
  • contracts/settings/v1/conformance.json
  • contracts/settings/v1/manifest.json
  • internal/api/handlers/plugins.go
  • internal/apiv2/settings.go
  • internal/apiv2/watch.go
  • internal/apiv2/watch_test.go
  • internal/catalog/detail.go
  • internal/plugins/runtime_config.go
  • internal/plugins/runtime_config_keys_test.go
  • internal/settingskeys/keys.go
  • web/src/api/types.ts
  • web/src/api/v2/schema.ts
  • web/src/api/v2/watch.ts
  • web/src/components/AppSidebar.test.tsx
  • web/src/components/settings/TheIntroDbReportSettings.tsx
  • web/src/hooks/queries/markerReportSettings.test.ts
  • web/src/hooks/queries/markerReportSettings.ts
  • web/src/hooks/queries/pluginSettings.ts
  • web/src/lib/markerProvenance.test.ts
  • web/src/lib/markerProvenance.ts
  • web/src/lib/markerReport.test.ts
  • web/src/lib/markerReport.ts
  • web/src/lib/pluginEntryValues.test.ts
  • web/src/lib/pluginEntryValues.ts
  • web/src/lib/settingsConformance.json
  • web/src/lib/settingsContract.ts
  • web/src/pages/settings/PlaybackSettings.test.tsx
  • web/src/pages/settings/PlaybackSettings.tsx
  • web/src/playback/WatchPlaybackChrome.tsx
  • web/src/player/components/IntroSkipButton.tsx
  • web/src/player/components/MarkerReportButton.tsx
  • web/src/player/components/VideoPlayer.tsx
  • web/src/player/components/WatchPage.trickplay.test.ts
  • web/src/player/components/WatchPage.tsx
  • web/src/player/types.ts
  • web/src/player/utils/watchPageMarkers.ts

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

Comment thread internal/catalog/detail.go Resolved
@Pasithea0
Pasithea0 force-pushed the feat/plugin-report-settings branch from da71809 to d9321d1 Compare October 25, 2026 21:36
@silo-kody

silo-kody Bot commented Oct 25, 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.


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: a4e9d97e-1a94-4f3a-8957-ab1e3ed9ca49
Commits

Reviewing files that changed from the base of the PR and between da71809 and d9321d1.

Files selected for processing: 4
  • internal/catalog/detail.go
  • internal/catalog/marker_v1_wire_test.go
  • web/src/components/settings/TheIntroDbReportSettings.test.tsx
  • web/src/components/settings/TheIntroDbReportSettings.tsx

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


const setShowReport = (checked: boolean) => {
if (!loaded) return;
update.mutate(updatePluginEntryObject(values, REPORT_SETTING_KEY, { show_report: checked }), {

@coderabbitai coderabbitai Bot Oct 25, 2026 •

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.

Major · Data Integrity & Integration · Heavy lift

Prevent lost updates to other plugin settings.

A successful read does not make values current. If another tab changes something_else after this tab reads it, changing show_report sends the old something_else value in a replace-all PUT. The PUT silently reverts the other tab’s change. The loaded guard prevents writes from an unknown map, but not this lost update. Update the report entry atomically, or use a versioned conditional write and retry on conflict. (raw.githubusercontent.com)

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.

Fixed in e2efe49. The settings contract carries no version for a caller to compare against and no per-entry write, so the closest available protection is to re-read immediately before the write and merge onto that read. useUpdatePluginEntry in web/src/hooks/queries/pluginSettings.ts does exactly that: a fetchQuery for the installation with staleTime: 0 (a fresh read, not the cached copy), the one field merged into the one entry, then the replace-all PUT. That narrows the window from the values query's 30 s staleTime to one round trip, and a failed re-read writes nothing rather than writing an empty base and clearing the account's other settings.

web/src/hooks/queries/pluginSettings.test.ts pins both halves: with the first read reporting something_else: older and the read taken at write time reporting newer, the PUT carries newer; a rejected read sends no PUT.

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.

Analysis chain

Script executed:

#!/bin/bash
set -u
printf '%s\n' '--- Revision ---'
git rev-parse HEAD
printf '%s\n' '--- Applicable instruction files ---'
for f in AGENTS.md web/AGENTS.md web/src/AGENTS.md web/src/hooks/AGENTS.md web/src/hooks/queries/AGENTS.md web/src/components/AGENTS.md web/src/components/settings/AGENTS.md; do
  if [ -f "$f" ]; then printf '\n--- %s ---\n' "$f"; cat "$f"; fi
done
printf '\n%s\n' '--- Source outlines ---'
for f in web/src/hooks/queries/pluginSettings.ts web/src/hooks/queries/pluginSettings.test.ts web/src/components/settings/TheIntroDbReportSettings.tsx; do
  if [ -f "$f" ]; then
    printf '\n--- %s ---\n' "$f"
    ast-grep outline "$f" --items all
  fi
done
printf '\n%s\n' '--- Hook source ---'
if [ -f web/src/hooks/queries/pluginSettings.ts ]; then cat -n web/src/hooks/queries/pluginSettings.ts | sed -n '1,260p'; fi
printf '\n%s\n' '--- Hook test source ---'
if [ -f web/src/hooks/queries/pluginSettings.test.ts ]; then cat -n web/src/hooks/queries/pluginSettings.test.ts | sed -n '1,300p'; fi
printf '\n%s\n' '--- Settings component source ---'
if [ -f web/src/components/settings/TheIntroDbReportSettings.tsx ]; then cat -n web/src/components/settings/TheIntroDbReportSettings.tsx | sed -n '1,160p'; fi
printf '\n%s\n' '--- API contract operations and settings writes ---'
rg -n -C 3 'updatePluginSettings|UpdateUserPluginSettings|PluginSettingsUpdate|plugin.*settings.*(PUT|put)|useUpdatePluginEntry' web/src internal/apiv2 internal/api/handlers contracts/api/v2/openapi.json -g '!**/*.test.ts' -g '!**/*.test.tsx' | head -240

Length of output: 53106


@Pasithea0 I checked e2efe49. The fresh read avoids using the screen’s stale values, and the tests cover a failed read. It does not prevent the original lost-update race.

If another tab writes after the fresh read but before this tab’s PUT, the PUT can still overwrite that change. The tests do not cover that interleaving.

I’m not marking the finding as addressed. Preventing the race requires an atomic server-side entry update or a conditional write. A test should interleave the other write between the read and PUT. I did not run the tests.


📝 Learnings were not changed: only organization members or users with write access to this repository can add or remove learnings.


If you found this review helpful, would you consider giving us a shout-out on X?

Thank you for using CodeRabbit!

You are interacting with an AI system.

Comment on lines +3479 to +3484
const markerReportAction = (kind?: string) =>
markerReportInstallationId && markerReportContentId ? (
<MarkerReportButton
installationId={markerReportInstallationId}
contentId={markerReportContentId}
kind={kind}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

kody code-review Bug medium

Incorrect report eligibility in web/src/player/components/VideoPlayer.tsx exposes scanner-generated, manually edited, and other-provider markers because markerReportAction checks only markerReportInstallationId and markerReportContentId, while reportMarkerSegment always submits complaints to TheIntroDB. Pass the active marker into the gate and require provenance identifying TheIntroDB to prevent viewers from contesting ranges it never supplied.

Prompt for LLM

File web/src/player/components/VideoPlayer.tsx:

Line 3479 to 3484:

Incorrect report eligibility in web/src/player/components/VideoPlayer.tsx exposes scanner-generated, manually edited, and other-provider markers because markerReportAction checks only markerReportInstallationId and markerReportContentId, while reportMarkerSegment always submits complaints to TheIntroDB. Pass the active marker into the gate and require provenance identifying TheIntroDB to prevent viewers from contesting ranges it never supplied.

Talk to Kody by mentioning @kody

Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.

​

​

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.

Fixed in 6136b56. The marker on screen is now passed into the gate, and the control is drawn only for a range whose provenance says TheIntroDB served it. isTheIntroDbRange (web/src/lib/markerProvenance.ts) matches the capability half of the provider id — plugin:<installation id>:introdb, or an unqualified introdb — so scanner-detected, manually edited and other-provider ranges no longer offer a report, and neither does a range with no recorded provenance, which is the conservative direction for a write aimed at a shared database.

The provider-qualification logic is now shared with the provenance badge (providerCapability), so the label and the gate cannot disagree about which provider a range came from. Cases in web/src/lib/markerProvenance.test.ts.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Thanks for the update. The provenance check you describe addresses the original concern: the report control is limited to ranges attributed to TheIntroDB, and unknown provenance is excluded.

Sharing the provider parsing with the badge also helps keep the label and eligibility check consistent. I haven’t independently verified commit 6136b56d5 or run its tests.

@macroscopeapp

This comment has been minimized.

@silo-kody

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

@silo-kody

silo-kody Bot commented Nov 2, 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 ❌

Comment thread internal/api/handlers/plugins.go Outdated
continue
}
views = append(views, toUserPluginSettingsSummary(installation, manifest))
views = append(views, toUserPluginSettingsSummary(installation, manifest, h.configuredGlobalKeys(ctx, installation.ID)))

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

kody code-review Performance high

Sequential database queries in internal/api/handlers/plugins.go increase shared settings request latency during normal AppSidebar navigation: the collection calls configuredGlobalKeys synchronously for every eligible installation, and each call executes ListGlobalConfigs and decrypts every stored configuration value, adding N sequential database round trips and full configuration decoding for N eligible plugins. Batch configuration retrieval for the eligible installation IDs before building the summaries.

Prompt for LLM

File internal/api/handlers/plugins.go:

Line 1198:

Sequential database queries in internal/api/handlers/plugins.go increase shared settings request latency during normal AppSidebar navigation: the collection calls configuredGlobalKeys synchronously for every eligible installation, and each call executes ListGlobalConfigs and decrypts every stored configuration value, adding N sequential database round trips and full configuration decoding for N eligible plugins. Batch configuration retrieval for the eligible installation IDs before building the summaries.

Talk to Kody by mentioning @kody

Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.

​

​

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.

Fixed in 40e534893 and carried through the rebase: the collection gathers the eligible installations first, then reads every installation's configured keys in a single query (ListConfiguredGlobalConfigKeysForInstallations, one WHERE plugin_installation_id = ANY($1)), and the detail path reads one installation. No per-installation round trip is left in the list.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Thanks for the update. The batched query addresses the N+1 database round trips described in the suggestion. Based on your description, the finding is resolved in 40e534893 and carried through the rebase. I haven’t independently verified the current code.

Pasithea0 and others added 9 commits November 13, 2026 21:19
…e known

The PUT replaces the whole stored set for an account and plugin, and the switch
merged onto whatever the values query returned. While that query was pending, or
after it failed, there was nothing to merge onto, so a write sent the report entry
alone and deleted every other entry the account had stored.

The switch now stays off until the current values are in hand and explains itself
when the read failed, and a test pins both that and the merge. Found in review.
The launch cookie is bound to the profile that asked for it, and the module-level
timestamp outlived a profile switch, so a second report could be sent under the
previous profile's authority. The timestamp is gone: each report mints its own
launch, which is what re-reads whoever is signed in at that moment. A report is a
deliberate, occasional action, so a round trip for it is cheaper than tracking the
current profile.

Found in review. The test that pinned the reuse now pins the mint.
An operator clearing the key left the row in place holding an empty object, and
configured_global_keys read row presence, so the per-account toggle stayed on offer
with nothing behind it: removing the key did not turn the report control off.

The store now names only the entries that carry something. Values are decoded to
judge emptiness and are never returned, so a secret still cannot leave through this
path.

Found in review and reproduced against a live database, where the cleared entry
decodes to an empty object and is now excluded.
GET /settings/plugins writes PluginUserSettingsView directly, so tagging the
field put it on a response the bridge carries unchanged. The v2 installation
maps it from the Go field instead, and a marshaling test now pins the v1 JSON.
…acts

They need a migrated database and skip without SILO_TEST_DATABASE_URL, so the
ordinary Go test job never selected them.
The user-facing settings list built one summary per installation, and each one
queried and decrypted that installation's stored config. The batched read
answers for every eligible installation in a single query, and keeps each
installation's keys grouped and in ascending order.
The batched read failed as a whole, so one row the cipher could not open
reported every eligible installation as unconfigured and took a working
plugin's dependent setting off offer. The damaged row is now dropped for its
own installation, with a warning naming the entry, which is what the
per-installation read did before the batch.
A report is addressed to TheIntroDB and contests a range it served, so the
control belongs under that range and no other. It was drawn under any skip
prompt, which offered a report on a range Silo's own scanner detected, one a
person edited, or one another provider supplied — none of which TheIntroDB
published, and all of which the plugin would forward as a complaint about a
range it never supplied.

The marker on screen is now the gate's input, and the capability half of its
provider id decides: isTheIntroDbRange matches 'plugin:<installation id>:introdb'
and an unqualified 'introdb'. A range with no recorded provenance is not
attributable and so not reportable, which fails in the safe direction for a
write aimed at a shared database. The provider-qualification rule is shared
with the provenance badge, so the label and the gate cannot disagree.

The report button's retry state also used the physical text-align utility,
which the RTL lint rejects: text-start mirrors under dir=rtl.
The PUT replaces the account's whole stored set for one installation, so a
replace-all write of the copy a screen happens to hold can revert a change
another tab or device stored after that copy was read. The values query's
staleTime is 30 seconds, which is the window.

The settings contract carries no version for a caller to compare against and
no per-entry write, so the closest available protection is to re-read
immediately before the write: useUpdatePluginEntry fetches the installation
(staleTime 0, so a fresh read rather than the cached copy), merges the one
field into the one entry, then sends the replace-all PUT. A failed re-read
writes nothing rather than sending an empty base, which would clear the
account's other settings. The switch also no longer builds a write at all
until the values query has succeeded.
@Pasithea0
Pasithea0 force-pushed the feat/plugin-report-settings branch from 28afa24 to e2efe49 Compare November 13, 2026 21:48
@silo-kody

silo-kody Bot commented Nov 13, 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 ❌

The strings this change needs are in Silo-Server/silo-translations#27, which is
open: an English-only catalog change waits for the maintainer's translation pass
and the release its merge publishes. Until then the catalog is generated from
that checkout with scripts/sync-translations --local, so the pin reads
local-56f90300dc5c rather than a release version.

Re-sync with scripts/sync-translations --version <release> once Silo-Server#27 merges; the
only difference then is the pin and the languages that gain the new keys.
src/components/settings/** and src/player/components/** are converted areas, so
their text comes from the shared catalog and the lint rejects literals in them.
Every string the report control and its setting show is now a message id,
including the tooltip sentence that names the segment, which is translated as a
whole with the segment's own name from web.markers.kind.*.

The three outcomes a report can end in keep their distinction: reported, already
reported, and a refused session are separate messages, because the viewer has to
be able to tell a repeat report from a vote that was just recorded. A rejection
from TheIntroDB still shows the plugin's own wording, which is server text and
is not re-phrased here.
@silo-kody

silo-kody Bot commented Nov 13, 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 ❌

The page is 799 lines on main, of which three are the placeholder comment the
marker-provenance change left for this feature, and the ratchet's limit for a
.tsx file is 800. Rendering the section here plus its import takes it to 801,
which the ratchet refuses — the failure the rebase surfaced, not a change in
this feature.

The comment now says the same thing in two lines, so the page lands on exactly
800 with the section rendered. The section itself is already its own file, so
nothing else moved.
@silo-kody

silo-kody Bot commented Nov 13, 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 ❌

@Pasithea0

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor
Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

The proxy flattened every route failure into a 502, so a plugin reporting a
provider-wide block through the host's typed retry contract — ResourceExhausted
with RetryInfo, which is what the marker lookup path records its cooldown from —
arrived at the browser as "plugin route failed". The viewer saw a broken report
rather than a provider asking them to wait.

A ResourceExhausted now answers 429 with Retry-After carrying the delay the
provider asked for; a block without a delay is still a 429 with no header, since
"0 seconds" would read as retry immediately. Every other failure stays a 502.
This is the route-proxy half of the contract the plugin already follows; the
cooldown itself belongs to the lookup path that owns provider health.
The report call had no branch for a rate limit, so the host's 429 fell through
to the generic message and the viewer was told the report could not be sent.
It now reads Retry-After and says when to come back; without a delay it still
says to come back rather than "in 0 seconds". The report was never sent, which
is what makes this different from a failure.
@silo-kody

silo-kody Bot commented Nov 13, 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: 4

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: 733f3152-5b8b-4b26-9b20-21b018b4cbad
Commits

Reviewing files that changed from the base of the PR and between 28afa24 and 143f056.

Files selected for processing: 23

  • .silo-translations
  • contracts/api/v2/openapi.json
  • internal/api/handlers/plugins.go
  • internal/apiv2/settings.go
  • scripts/ci/db-contracts.txt
  • web/src/api/v2/schema.ts
  • web/src/components/AppSidebar.test.tsx
  • web/src/components/settings/TheIntroDbReportSettings.test.tsx
  • web/src/components/settings/TheIntroDbReportSettings.tsx
  • web/src/hooks/queries/pluginSettings.test.ts
  • web/src/hooks/queries/pluginSettings.ts
  • web/src/lib/markerProvenance.test.ts
  • web/src/lib/markerProvenance.ts
  • web/src/locales/ar-XB.json
  • web/src/locales/en-XA.json
  • web/src/locales/en.json
  • web/src/locales/keys.ts
  • web/src/pages/settings/PlaybackSettings.test.tsx
  • web/src/pages/settings/PlaybackSettings.tsx
  • web/src/player/components/IntroSkipButton.tsx
  • web/src/player/components/MarkerReportButton.tsx
  • web/src/player/components/VideoPlayer.tsx
  • web/src/player/components/WatchPage.tsx

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

Comment on lines +146 to +147
.then((current) =>
mutation.mutate(updatePluginEntryObject(current, entryKey, patch), {

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.

Major · Data Integrity & Integration · Quick win

Pass the captured account context to both the read and the replacement write.

setEntryValue reads the stored values, then sends a replace-all PUT. Neither request passes profileContext. Without a snapshot, sendV2 skips its stale-account check, and each request uses the session active when it is built. If the active account changes after the GET starts and before the PUT is sent, the PUT can send the new account's session with a map built from the previous account's values. That overwrites the new account's stored plugin settings.

Capture the context once at the start of setEntryValue with captureProfileRequestContext(), and return onError when it is null. Pass that snapshot to the GET, and carry it into the PUT through the mutation variables. Both requests then use the captured account's credentials, so the write cannot land in a different account. useUpdatePluginSettings currently accepts only the values map, so its variables must include the snapshot as well.

*/
export function MarkerReportButton({ installationId, contentId, kind }: MarkerReportButtonProps) {
const t = useT();
const [phase, setPhase] = useState<Phase>({ state: "idle" });

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.

Minor · Data Integrity & Integration · Quick win

Reset the report control when its target changes.

MarkerReportButton keeps phase in local state, and nothing resets it when contentId changes. If the control stays mounted across an episode change, two problems can follow:

  • A confirmation opened for the previous target can stay open. A confirm click then sends a report for the new target without the first click that the two-step flow requires.
  • A request still in flight for the previous target can finish after the change. Its completion sets done on the new target's control, which shows a success message for a report that was not sent for that target.

Key the control by its report target so each target starts with a new phase:

Suggested fix

   const markerReportAction = (marker?: (PlayerMarkerProvenance & { kind?: MarkerKind }) | null) =>
     markerReportInstallationId && markerReportContentId && isTheIntroDbRange(marker) ? (
       <MarkerReportButton
+        key={`${markerReportInstallationId}:${markerReportContentId}`}
         installationId={markerReportInstallationId}
         contentId={markerReportContentId}
         kind={marker?.kind}
       />
     ) : null;

setPhase({ state: "failed", message: t("web.markers.report.sessionExpired") });
return;
default:
setPhase({ state: "failed", message: result.message });

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.

Minor · Functional Correctness · Quick win

Translate Silo-owned report failure messages.

reportMarkerSegment returns fixed English messages for network failures, HTTP 503, and failures without a usable response message. This branch displays those messages unchanged. These paths therefore remain English when the viewer selects another language.

Return a failure code for Silo-owned messages and translate that code here. Keep plugin-provided text separate from those codes.

As per coding guidelines, “Every piece of text a user can see ships with its catalog entry and translations.”

Source: Coding guidelines

showMarkerConfidence={showMarkerConfidence}
showMarkerSource={showMarkerSource}
markerReportInstallationId={markerReport.installationId}
markerReportContentId={contentId}

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.

Major · Data Integrity & Integration · Quick win

Hide the report target while the new episode replaces the session.

An episode change keeps the previous session on screen until the replacement is adopted. WatchPage passes the new contentId at once, so a report can name the new episode while the stream and its markers still belong to the previous one. Nothing remounts the player, so the mismatch can occur.

Pass no report target while session.replacing is true:

Suggested fix

--- "a/web/src/player/components/WatchPage.tsx"
+++ "b/web/src/player/components/WatchPage.tsx"
@@ -736,7 +736,7 @@
       showMarkerConfidence={showMarkerConfidence}
       showMarkerSource={showMarkerSource}
       markerReportInstallationId={markerReport.installationId}
-      markerReportContentId={contentId}
+      markerReportContentId={session.replacing ? null : contentId}
       bufferingMode={bufferingMode}
       bandwidthCapKbps={maxBitrateKbps}
       bufferingTitleId={contentId}

This gate applies from the render after the replacement starts. The report control returns when the new plan is adopted. A same-title version switch also hides the control during its replacement.

Committable suggestion

IMPORTANT
Review the replacement and indentation, then test before committing.

Suggested change
markerReportContentId={contentId}
markerReportContentId={session.replacing ? null : contentId}

staticcheck S1016: the two stub structs had the same single field, so the
service now carries its client rather than a copy of the field, which is what
the literal was standing in for anyway.
@silo-kody

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

Copy link
Copy Markdown
Contributor

Letting viewers flag a wrong TheIntroDB segment from the player is worth having, but it needs to be provider-agnostic: marker providers should declare reporting through the plugin SDK, and Silo should expose it as a native /api/v2 operation any client can call. This branch writes one plugin's id, setting names, and route into the core web app, so no other marker provider can offer reports and the Apple and Android apps can't implement it. I recommend reworking it that way, so I haven't reviewed the code line by line. Reviewed at 511e8b9, including the translation and rate-limit commits, which don't change the shape.

What that would look like:

  • In the SDK, marker_provider.v1 gains an optional report call. It takes the same media identity the marker fetch uses, including the episode numbering the host chose, plus the segment kind, and answers reported, already reported, or a refusal with a reason. The provider decides whether it can report (for TheIntroDB, whether a key is configured), so the host doesn't infer that from config key names and configured_global_keys isn't needed.
  • On the server, an operation such as POST /api/v2/markers/files/{file_id}/{segment}/report looks up which provider supplied that segment, resolves the identity server-side, and calls that provider. Marker responses say per segment whether it can be reported.
  • Clients show the report control when a segment is reportable, with no plugin id in client code. The viewer's opt-in becomes an ordinary user setting rather than a TheIntroDB-specific plugin entry.

Three problems in the current shape that this removes:

  • The report target is parsed out of the content id. docs/architecture/api-contract.md says clients don't parse identifiers, and the season and episode in the id can follow a different numbering from the one the marker fetch sent TheIntroDB, so a report can land on the wrong episode.
  • Plugin-content routes are a browser surface. docs/architecture/plugin-content.md notes that native clients don't use them, so this design can't reach the other apps.
  • The flag carries no segment kind. A report covers the whole episode or movie while the button names one segment, and once anyone on the server has reported an item, every later report on it shows "Already reported".

On the plugin side, Silo-Server/silo-plugin-markers-theintrodb#14 would implement the SDK call instead of serving its own route.

Fit: 4/10. Reporting bad markers belongs in Silo, but marker providers are a plugin interface where several implementations are plausible (the core/plugin line in AGENTS.md), so reporting has to go through that interface rather than around it.

🤖 Claude Code (claude-opus-5-5)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api-v2 API v2 / Huma migration program (epic #135); long-running, stacked by phase enhancement New feature or request evidence-required Needs before-and-after evidence before the Evidence check passes go Pull requests that update go code impact: compat Breaks a supported client or server path impact: playback Can't play, stalls, or wrong media impact: usability Core flow broken or severely blocked javascript Pull requests that update javascript code needs-review Needs maintainer review to resolve uncertain classification, scope, or changed evidence. priority: P2 Limited scope, workaround exists, or polish priority: P3 Needs-info or parked size/XXL 1000–2999 added + deleted lines (all files); change volume, not priority. stacked Base is another open PR; merge in stack order named in the body

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants