You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(plugins): let a screen gate a user setting on administrator configuration - #3085
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.
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
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.
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.
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.
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.
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.
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.
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: 4
Check name
Status
Explanation
Title check
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
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Description check
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
The reason will be displayed to describe this comment to others. Learn more.
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.
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").
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.
The reason will be displayed to describe this comment to others. Learn more.
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.
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.
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.
The reason will be displayed to describe this comment to others. Learn more.
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.
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.
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.
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 2 remain after this review.
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 0 remain after this review.
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)
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.
@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?
The reason will be displayed to describe this comment to others. Learn more.
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.
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.
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.
The reason will be displayed to describe this comment to others. Learn more.
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.
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.
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.
…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.
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.
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.
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.
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.
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.
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.
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:
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.”
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:
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.
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.
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".
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
api-v2API v2 / Huma migration program (epic #135); long-running, stacked by phaseenhancementNew feature or requestevidence-requiredNeeds before-and-after evidence before the Evidence check passesgoPull requests that update go codeimpact: compatBreaks a supported client or server pathimpact: playbackCan't play, stalls, or wrong mediaimpact: usabilityCore flow broken or severely blockedjavascriptPull requests that update javascript codeneeds-reviewNeeds maintainer review to resolve uncertain classification, scope, or changed evidence.priority: P2Limited scope, workaround exists, or polishpriority: P3Needs-info or parkedsize/XXL1000–2999 added + deleted lines (all files); change volume, not priority.stackedBase is another open PR; merge in stack order named in the body
2 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 globalconfig 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
mainatb6b7dd38f; the branch had been 325 commits behind, so everythingbelow ran against the merge base this pull request actually has.
format:check, the production build and its bundlebudget 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).
ci / Go testandci / Go DB pinscover the changed packages, including the newdatabase-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.
(regenerating
web/src/api/v2/schema.tsfrom the committed OpenAPI document is ano-op), the pre-lock contract diff, playback fixtures and the v1 route freeze all pass.
came back as the plugin's own validation errors relayed through Silo, and nothing was
written upstream.
Evidence
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_keysnames every stored config entry that holds a value, includingone 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
AI Disclosure
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
PUTreplaces the whole stored set, and theswitch 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_keysreported 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 mergesthe 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/**andsrc/player/components/**taketheir 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 languagesthat 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 theplugin 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
ResourceExhaustednow answers 429 withRetry-Aftercarrying the delay the providerasked 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
show_reportplugin setting on whether the administrator has configured the plugin's global account key. The playback settings page renders aTheIntroDbReportSettingsswitch that is disabled with an explanatory message when the key is absent (TheIntroDbReportSettings.tsx).configured_global_keysfield, populated byListConfiguredGlobalConfigKeysForInstallationswhich only counts entries carrying real values (empty objects and blank strings are unset) (http_proxy.go, runtime_config.go).VideoPlayerrendersMarkerReportButtonbelow 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.ResourceExhaustedgRPC errors to 429 with a rounded-upRetry-AfterfromRetryInfo; other errors still return 502.configured_global_keysarray (v1 JSON omits it); unreadable encrypted config entries exclude only their own installation's keys rather than failing the batch.Macroscope summarized 511e8b9.