Skip to content

fix(plugins): show a refused automatic plugin update in web admin - #3357

Merged
Quick104 merged 6 commits into
Silo-Server:mainfrom
Rhainland:fix/3237-refused-plugin-update
Nov 9, 2026
Merged

Quick104 merged 6 commits into
Silo-Server:mainfrom
Rhainland:fix/3237-refused-plugin-update

Conversation

@Rhainland

@Rhainland Rhainland commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Closes #3237
Related issue: #1223
Validation tasks: changes #1225 C1

When an automatic plugin update is refused, for example because the download doesn't match its catalog checksum, web admin never says so. Check for updates reports only that the check started, and the plugin's tile and page show nothing; the reason reaches only the server log and a failed Check Plugin Updates run. This change records the refused update on the plugin and shows it on the Plugins page and the plugin's page, with the version and the reason.

Approach

  • The update check stores the refused version, the reason and the time on the plugin's plugin_installations row (three new nullable columns, added by an additive migration). The reason is the administrator-facing PackageError message that a manual Update to already shows, which names no URL or checksum; any other failure gets a generic line pointing at the server log. Because the record is in Postgres, every node returns it.
  • The record clears when the installed version changes (any install, replace or manual update) or when a later check handles the plugin without failing, including when the catalog no longer offers a newer version or the plugin no longer has a repository (its repository was deleted). A check that can't reach the plugin's repository leaves it in place. A plugin uninstalled while a check runs doesn't count as a failed operation.
  • /api/v2 installation responses gain an optional update_failure object (version, reason, failed_at). The frozen /api/v1 view does not carry it. docs/admin-api.md describes the field.
  • Web admin shows "Update to failed" on the plugin's tile and a warning with the reason on its page. When a plugin update check finishes, and after the events connection reconnects, the installations list refreshes, so the result appears without reloading the page.
  • An update check writes a refusal only while the version it tried to update from is still installed, so a manual update that wins the race isn't marked as refused. A successful manual replacement returns the installation without the old refusal.
  • A refused update also counts toward the Plugins page's Needs attention filter. The plugin's status label stays as it was.
  • A backup restore carries the record with the live server's release of each plugin, so a restored plugin doesn't show a refusal from backup time for a version it no longer runs.

jellycompat has no plugin administration, so it needs no change. silo-apple and silo-android have no plugin admin screens and don't read the installation API, so no client follow-up is needed.

Validation

  • Reproduced on origin/main against a local server with a local test catalog listing a newer release of an installed plugin under a wrong SHA-256: no feedback on the tile or page after Check for updates. On the fix branch, the same steps show the notice on the tile (without a reload) and the plugin page, at desktop and phone widths. Correcting the checksum and checking again installed the new version and removed the notice. The /api/v1 installation list is unchanged.
  • Go: go build ./..., gofmt, go vet, make lint-changed (0 issues) and make lint-router-recovery pass. make test-go passes except two internal/jellycompat Dolby Vision strip tests, which fail the same way on the unmodified base on this machine.
  • New tests: the update check records, keeps and clears the refused update and picks the reason text; a Postgres contract test (added to scripts/ci/db-contracts.txt) stores, clears and version-clears the record. Both ran against a migrated database.
  • After merging current main: the restore round-trip test (TestBackupRestoreRoundTripDB) now also checks that a restored plugin takes the live server's refused-update record. It fails on the merged branch without the restore fix and passes with it.
  • Web: pnpm run lint (no new findings), format:check, build, budget:check and make test-web pass.
  • Contracts and hygiene: verify-apiv2-openapi, verify-apiv2-contract (additive changes only), verify-apiv2-fixtures, verify-apiv2-web-types, TestCommittedArtifactMatchesRouter, verify-migrations, verify-migration-ledger, verify-v1-route-freeze, verify-route-inventory, verify-local-paths, verify-size-ratchet, verify-case-collisions and verify-bidi pass. Not run: verify-actionlint, verify-shellcheck, verify-prometheus-rules, verify-settings-bindings-all, verify-playback-fixtures, verify-scenario-catalogs and verify-offline-routes, since nothing they check changed.

Evidence

Evidence: https://evidence.siloserver.org/r/silo-server/pr-3357/

Surface and build: web admin Plugins page and plugin page, desktop (1440 px) and phone (390 px), before on origin/main and after on this branch, same local data.

Risks

The migration adds three nullable columns to plugin_installations and needs no maintenance window. Each update check writes one extra row update for a plugin whose stored record it sets or clears. Older web builds ignore the new field. #1225 C1 asks the validator to observe update and failure feedback; a refused automatic update now shows on the Plugins page as well as in Logs and Scheduled Tasks, which is what the issue asks for, so C1 should be re-run on a build with this change.

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: Claude Code (via T3 Code); Codex CLI for code review
  • Tool(s): Claude Code, Codex CLI, GitHub CLI, git, Go toolchain, pnpm, Docker, Playwright (headless Chromium)
  • Model(s): claude-opus-5-5; gpt-6.1-sol (code review)
  • Involvement: Fully AI-generated, human verified
  • Adversarial review: independent reviews of the full diff by claude-opus-5-5 and gpt-6.1-sol on correctness, repository standards and the issue's requirements. GPT found that a check finishing while the events connection was down left the page stale until the next refresh; fixed by refreshing installations on reconnect. Opus found the new web type had separated a doc comment from its interface; fixed. No other findings. Bot review on the PR then found the stale refusal in replacement responses and the race with a manual update (both fixed and tested), and asked for the Needs attention filter (added); a second dual review of that follow-up found only an over-broad doc comment, now narrowed. The two earlier review fixes were then re-read against the rebased branch, with the focused Go tests, the Postgres contract test and verify-apiv2-contract re-run. A later review (Claude Code, claude-opus-5-5, with a gpt-6.1-sol cross-check) found that a refusal on a plugin whose repository was deleted never cleared, and that removing a plugin during a check failed the run; both are fixed in 5c35b22 with table-test rows that fail on c25255f. A review after merging current main (Claude Code, claude-opus-5-5) found that a backup restore kept a refusal from backup time on a plugin running a newer version; fixed in b326330, with a test check that fails without it.

Note

Record and display refused automatic plugin updates in web admin

  • The automatic update pass now persists a refused update (target version, sanitized reason capped at 500 runes, UTC time) via AutoUpdateService.recordUpdateFailure in auto_update.go, and clears the record when the update succeeds or the installed version changes.
  • New nullable columns update_failed_version, update_failure_reason, update_failed_at are added to plugin_installations in 20261101154758_plugin_update_failures.sql, with a down migration.
  • The v2 admin API (AdminPluginUpdateFailure), the web frontend types, the plugin tile alert, and the plugin detail page warning banner all surface the failure. pluginStatus marks such installations as needing attention at rank 2.
  • Backup transfers now carry the refused-update columns with plugin releases, and restoring a live release clears them.
  • Behavioral Change: the frozen v1 admin API view does not include update_failure; v1 consumers see no change. The frontend invalidates the plugin-installation query when check_plugin_updates becomes idle or on reconnect.

Macroscope summarized b326330.

The update check now records the version and the admin-facing reason on
the installation when an automatic update fails, and clears it once the
installed version changes or a later check no longer fails. The v2
installation view returns it as update_failure, and the Plugins page and
the plugin's page show it.
A plugin update check that finished while the events socket was down now
shows its result too. Also keep the PluginRuntime doc comment on its type.
@silo-triage silo-triage Bot added the size/L 200–499 added + deleted lines (all files); change volume, not priority. label Nov 1, 2026
@silo-kody

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

Copy link
Copy Markdown

The published evidence link and description cover before-and-after captures of the Plugins page and plugin detail page at desktop and phone widths. The remaining visible behavior is the post-check refresh: please include a short recording showing the failed update check finish and the warning appear without reloading the page.

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 Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Walkthrough

The pull request records refused automatic plugin updates with the attempted version, reason, and timestamp. The admin API exposes this information, and the web admin displays it on plugin tiles and detail pages. The installation record clears after a version change or a non-failing check.

Changes: Plugin update failure reporting

Layer / File(s) Summary
Persist update failure state
internal/plugins/installation.go, migrations/sql/20261101154758_plugin_update_failures.sql, internal/plugins/builtin_guard_test.go, scripts/ci/db-contracts.txt
Installation records and database columns store the failed version, reason, and time. Updates can set or clear the record. The database test checks retrieval, clearing, and version-guard behavior.
Record automatic update outcomes
internal/plugins/auto_update.go, internal/plugins/auto_update_replace_test.go, internal/plugins/installer.go, internal/plugins/installer_replace_test.go
The automatic update check records failed updates and clears prior failures after non-failing handling. Failure reasons use a sanitized package error message or a generic fallback, capped at 500 runes. Replacements clear the failure record.
Expose failure details in the admin API
internal/api/handlers/plugins.go, internal/apiv2/admin_plugin_installations.go, contracts/api/v2/openapi.json, web/src/api/types.ts, web/src/api/v2/schema.ts, docs/admin-api.md
The API returns an optional update_failure field with the attempted version, reason, and timestamp. The schemas and documentation describe the field. The frozen v1 view does not include it.
Refresh and display update failures
web/src/components/RealtimeEventsProvider.tsx, web/src/lib/pluginStatus.ts, web/src/lib/pluginHelpers.test.ts, web/src/components/admin/plugins/PluginTile.tsx, web/src/pages/AdminPluginDetail.tsx
The web admin refreshes plugin installations after update checks. Plugin tiles and detail pages display recorded failure information, and plugin status marks the installation for attention.

Breaking-change approval metadata

Layer / File(s) Summary
Update approval list
contracts/api/v2/breaking-approvals.json
The approvals for two diagnostic-report response-enum changes were removed.

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

Change: Bug fix · Severity of issue fixed: Medium

Sequence Diagram(s)

sequenceDiagram
  participant AutoUpdateService
  participant InstallationStore
  participant AdminPluginInstallationOf
  participant AdminAPI
  participant PluginAdmin
  AutoUpdateService->>InstallationStore: Store failed version, reason, and timestamp
  InstallationStore->>AdminPluginInstallationOf: Provide installation failure details
  AdminPluginInstallationOf->>AdminAPI: Map details to the optional response field
  AdminAPI->>PluginAdmin: Return installation data for display
Loading

Possibly related issues

Possibly related PRs

Suggested reviewers: quick104

Merge Risk: Low · up to 5c35b

The change is mergeable with owner awareness: overlapping checks can temporarily remove a valid update-failure notice from the admin view, although the plugin remains operational.

Security architecture risk: Low · up to 5c35b

The change preserves package verification and keeps failure details within the existing administrator interface. The main concern is that overlapping checks can erase a newer failure warning. This affects visibility of rejected updates, not whether an unverified package can be installed.

Retained concerns

  • Low · reliability · inferred: A stale, non-failing check can erase a newer refusal warning. If check A observed an existing failure, check B records another refusal for the same installed version, and A then clears its snapshot's failure, the clear updates by installation ID without checking which failure is current. Startup and task entrypoints can overlap, and the task-worker mutex is local. This can hide a checksum-refusal warning across administrator views, although package rejection, logs, and failed-task reporting are not bypassed. This is a consistency defect in the newly introduced diagnostic state, not evidence that pre-existing package security was weakened.
Security review details

Security Blast Radius

  • inferred — The identified consistency defect affects an installation's shared failure record and administrator warning wherever that row is read. It does not grant package-installation authority, and existing failed-task reporting remains a separate visibility channel.

Security Findings and Attack Paths

  • inferred — No package-verification bypass was established in the inspected change. Automatic installation still follows the existing resolver and replacement path, including checksum verification before binary replacement; recording is a downstream diagnostic action after an update outcome. Loss of a refusal warning must therefore be distinguished from execution of a rejected package.

Trust Boundaries and Controls

  • observed — The new response field uses the existing installation operation declared ClassActingAdmin, not a new public endpoint. That class specifies authenticated administrator access. The v1 bridge omits the field, and the recorder does not persist the wrapped operational error.

Resilience and Maintainability Implications

  • inferred — Failure recording is best-effort rather than an atomic part of the failed update. It uses the caller's context, and persistence errors are added to the summary. Cancellation can therefore prevent a new durable warning; no independently retried recovery write was established. This limits durability guarantees without weakening package verification.

Hardening Proposals

  • proposed — Make clearing conditional on the installed version and the failure identity observed by the check, so an older successful pass cannot delete a newer refusal. This would strengthen the diagnostic-state lifecycle without expanding updater authority.
Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 36.36% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed

Check name Status Explanation
Title check Passed The title clearly and concisely describes the primary change: showing refused automatic plugin updates in the web admin.
Linked Issues check Passed [#3237] requires web admin to show a refused automatic plugin update, with the attempted version and reason, on the Plugins page or the plugin page. Head 5c35b22 implements this. The migration adds …
Out of Scope Changes check Passed Each changed area supports #3237. Persistence (migration, Installation/UpdateInstallationInput fields, InstallationStore.Update) stores and clears the refusal. The auto-update service writes it. The i…
Description check Passed The description is directly related to the changeset. It explains the problem (refused automatic plugin updates are not shown in web admin), the approach (three nullable columns on plugin_installation…
Full details: Linked Issues check

Explanation

[#3237] requires web admin to show a refused automatic plugin update, with the attempted version and reason, on the Plugins page or the plugin page. Head 5c35b22 implements this. The migration adds three nullable columns to plugin_installations. AutoUpdateService.Check stores the refused version, a sanitized PackageError reason (max 500 runes) or a generic reason, and a UTC time. The v2 API adds optional update_failure (AdminPluginUpdateFailure). PluginTile.tsx shows a failure warning with the reason. AdminPluginDetail.tsx shows a warning banner with the version, reason and time. RealtimeEventsProvider refreshes installations after a check finishes and after reconnect, so the notice appears without a reload. The Needs attention filter also counts the refusal. The reported scenario (checksum mismatch on a newer catalog release) is covered by the recording path, and tests in auto_update_replace_test.go, builtin_guard_test.go and installer_replace_test.go cover recording, clearing and version guards. The later fixes (clearing for a plugin with no repository, ignoring a missing installation on clear) support the same requirement. #1223 and #1225 are contextual validation references and add no active coding requirement. Limitation not covered by #3237: a plugin missing from the catalog keeps its refusal record (auto_update summary: missing catalog entries leave records unchanged). The issue does not require clearing in that case.

Full details: Out of Scope Changes check

Explanation

Each changed area supports #3237. Persistence (migration, Installation/UpdateInstallationInput fields, InstallationStore.Update) stores and clears the refusal. The auto-update service writes it. The installer clears it after a successful replacement, so stale refusals do not show. The v2 API schema, openapi.json, admin-api.md, the generated web types and the web components display it. The Needs attention filter (pluginStatus.ts and its test) extends the Plugins page display of the same refusal. The v1 bridge is unchanged: internal/api/handlers/plugins.go adds UpdateFailure with json:"-" and a comment that the frozen v1 bridge does not carry it, so /api/v1 output does not change. contracts/api/v2/breaking-approvals.json drops two approvals, which the PR describes as contract-gate maintenance for already merged changes. It does not alter runtime behavior. scripts/ci/db-contracts.txt registers the new Postgres test. No unrelated functional change is established. Note: the repository diff tool could not read the changed blobs, so this verdict uses the supplied summary plus a file read of internal/api/handlers/plugins.go at head.

Full details: Description check

Explanation

The description is directly related to the changeset. It explains the problem (refused automatic plugin updates are not shown in web admin), the approach (three nullable columns on plugin_installations, a v2-only update_failure field, and web tile and page warnings), validation steps, and risks. The level of detail is not a factor for this check, and the description is clearly on topic.

Full details: Docstring Coverage

Explanation

Docstring coverage is 36.36% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 11 functions across 14 files.

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent 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: bd05ad5e-cf1f-4be7-b36a-d011d2dedecd
Commits

Reviewing files that changed from the base of the PR and between c25255f and 5c35b22.

Files selected for processing: 2

  • internal/plugins/auto_update.go
  • internal/plugins/auto_update_replace_test.go

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

@silo-triage silo-triage Bot added bug Something isn't working priority: P2 Limited scope, workaround exists, or polish labels Nov 1, 2026
CreatedAt: installation.CreatedAt,
UpdatedAt: installation.UpdatedAt,
Runtime: runtime,
UpdateFailure: installation.UpdateFailure,

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

Stale UpdateFailure values appear in successful replacement responses through the new projection in internal/api/handlers/plugins.go because installer.replaceBinary and installer.replaceArchive return shallow copies of the old installation without clearing that field, although their database Version updates clear it. Reload the committed installation or clear UpdateFailure on both returned replacement objects so successful install/upload responses do not report the completed update as still refused.

Prompt for LLM

File internal/api/handlers/plugins.go:

Line 1496:

Stale UpdateFailure values appear in successful replacement responses through the new projection in internal/api/handlers/plugins.go because installer.replaceBinary and installer.replaceArchive return shallow copies of the old installation without clearing that field, although their database Version updates clear it. Reload the committed installation or clear UpdateFailure on both returned replacement objects so successful install/upload responses do not report the completed update as still refused.

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 c25255f. Both replacement paths now drop the record from the installation they return, matching the row the version change just cleared. TestInstallerReplaceBinaryPreservesInstallationID covers it, and on a local build re-uploading the plugin after a recorded refusal returns no update_failure.

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—based on your description, clearing UpdateFailure in both returned replacement objects addresses the original finding and keeps successful responses consistent with the database. The regression test and local re-upload check cover the reported stale-response behavior.

Comment thread internal/plugins/auto_update.go Outdated
Comment on lines +545 to +546
if err := s.installations.Update(ctx, existing.ID, input); err != nil {
summary.recordFailuref("record update result for plugin %s: %v", existing.PluginID, err)

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

Race condition identified in internal/plugins/auto_update.go: the failure write matches only existing.ID, allowing a failed automatic download to restore an obsolete refusal after a concurrent manual replacement succeeds and clears it. Condition the write atomically on the original installed version to prevent the stale update attempt from overwriting the replacement result.

Prompt for LLM

File internal/plugins/auto_update.go:

Line 545 to 546:

Race condition identified in internal/plugins/auto_update.go: the failure write matches only existing.ID, allowing a failed automatic download to restore an obsolete refusal after a concurrent manual replacement succeeds and clears it. Condition the write atomically on the original installed version to prevent the stale update attempt from overwriting the replacement result.

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 c25255f. The refusal write now carries IfVersion with the version the check tried to update from, and the store adds AND version = $n. If a manual update has changed the version in the meantime, the write does nothing. TestInstallationStoreUpdateFailureDB covers the stale write against Postgres, and the update-check test asserts the guard value.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

That addresses the reported race: the atomic AND version = $n guard prevents a stale refusal from being written after a manual update changes the installed version.

The Postgres stale-write test and the update-check assertion cover both enforcement of the condition and propagation of IfVersion. Based on your description, this finding is addressed.

@macroscopeapp

macroscopeapp Bot commented Nov 1, 2026

Copy link
Copy Markdown

Major change: Web admin C1

#1225 C1 passed on build 1669 · 5ec82048 and explicitly asks the validator to observe update/failure feedback. This PR adds persisted refused-update data and displays it on plugin tiles and detail pages, changing the result that step observes. Please explain why this validated behavior is changing and re-validate C1 after merge. The current Validation tasks: changes #1225 C1 line matches this impact.

Automated check: Macroscope check run agent (gpt-6-luna). No validation was performed.

Posted via Macroscope — v1 validation impact

@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: 3


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: b7219091-c229-4f3a-a0f5-e9c1338323b7
Commits

Reviewing files that changed from the base of the PR and between 8bc4f2a and 6d6c9b8.

Files selected for processing: 16
  • contracts/api/v2/breaking-approvals.json
  • contracts/api/v2/openapi.json
  • docs/admin-api.md
  • internal/api/handlers/plugins.go
  • internal/apiv2/admin_plugin_installations.go
  • internal/plugins/auto_update.go
  • internal/plugins/auto_update_replace_test.go
  • internal/plugins/builtin_guard_test.go
  • internal/plugins/installation.go
  • migrations/sql/20261101154758_plugin_update_failures.sql
  • scripts/ci/db-contracts.txt
  • web/src/api/types.ts
  • web/src/api/v2/schema.ts
  • web/src/components/RealtimeEventsProvider.tsx
  • web/src/components/admin/plugins/PluginTile.tsx
  • web/src/pages/AdminPluginDetail.tsx

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

Comment thread internal/plugins/auto_update.go Resolved
A manual replacement returned its installation with the refusal the version
change had just cleared, and an update check that lost a race to a manual
update could record its refusal against the newer version. The replacement
result now drops the record, and the check writes it only while the version
it tried to update from is still installed. A refused update also counts
toward the Plugins page's Needs attention filter.
@silo-kody

silo-kody Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.

Reviewing changes in Silo
  • Include the related issue, expected behavior, and validation steps in the PR description.
  • For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
  • For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
  • Follow this repository's AGENTS.md and CONTRIBUTING.md.
  • Request another review with @kody start-review in a PR comment.
  • React with 👍 or 👎 to give feedback on individual suggestions.
Review settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1


Review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d2c76330-6f7c-44d3-af02-c15a2edd42ff
Commits

Reviewing files that changed from the base of the PR and between 6d6c9b8 and c25255f.

Files selected for processing: 8
  • internal/plugins/auto_update.go
  • internal/plugins/auto_update_replace_test.go
  • internal/plugins/builtin_guard_test.go
  • internal/plugins/installation.go
  • internal/plugins/installer.go
  • internal/plugins/installer_replace_test.go
  • web/src/lib/pluginHelpers.test.ts
  • web/src/lib/pluginStatus.ts

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

}
input.IfVersion = &existing.Version
case updateErr == nil && existing.UpdateFailure != nil:
input.ClearUpdateFailure = true

@coderabbitai coderabbitai Bot Nov 1, 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.

Minor · Data Integrity & Integration · Quick win

Condition the clear on the failure that this check observed.

If two checks overlap, a check using an older installation snapshot can clear a refusal recorded by the later check. The clear sets no IfVersion condition, and a version condition alone would not protect a newer refusal for the same installed version. Make the clear conditional on the observed failure record in the row update. Otherwise, the admin view can lose the later refusal. (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.

Leaving this as is. Overlapping checks are possible: each replica runs a startup pass and its own scheduled task. But a clear only removes a newer refusal when two overlapping checks disagree about the same plugin, one failing and one succeeding or finding nothing newer. That only happens when the catalog or the download changed between them, so the later outcome isn't clearly the right one to keep. When it does happen, the next check re-records the refusal, because the catalog still lists the version and the download still fails. Nothing wrong stays stored; the notice is missing until then. A compare-and-clear on the stored failure would add a second conditional write path to the store for that window, which I don't think it justifies.

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.

@Rhainland Understood. The race can temporarily remove the refusal notice, but a later check can restore it if the update still fails. You have accepted that limitation to avoid a second conditional write path. I won’t press for compare-and-clear here.

You are interacting with an AI system.

@macroscopeapp

macroscopeapp Bot commented Nov 1, 2026

Copy link
Copy Markdown

Major change: Server C1

The Server task #1224 C1 passed on build 1669 · 5ec82048 and exercised a catalog auto-update with a wrong checksum. Its validation notes that the refusal left the old version running but recorded no failure. This PR now persists that refusal on the installation and exposes it through the v2 admin API, so the validated result changes even though checksum rejection remains intact.

The PR must explain why this validated behavior is changing, and C1 needs re-validation after merge. The current Validation tasks: line omits this affected server case. Suggested correction:

Validation tasks: changes #1224 C1; changes #1225 C1

Automated check: Macroscope check run agent (gpt-6-luna). No validation was performed.

Posted via Macroscope — v1 validation impact

@Quick104 Quick104 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 of c25255f. Two findings, both in the update check's record and clear logic. I'm fixing both in a commit on this branch, so there's no need to change anything yourself.

The rest held up: the admin list reads plugin_installations directly, so every node returns the same record and no per-node cache serves it. The /api/v2 field is additive and stays out of /api/v1. Every version change goes through Update(Version), so it clears the record.

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

Comment thread internal/plugins/auto_update.go Resolved
Comment thread internal/plugins/auto_update.go Resolved
A refused automatic update stayed on a plugin whose repository was
deleted (repository_id goes NULL), because the update check skips such
plugins before recording or clearing. The notice and Needs attention
flag then never cleared. The check now clears the record for a plugin
without a repository, which has no automatic update left to fail.

A clear that finds the plugin already uninstalled no longer counts as a
failed operation, so removing a plugin during a check doesn't fail the
Check Plugin Updates run.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@silo-kody

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

Copy link
Copy Markdown
Contributor

Review summary

Reviewed head: b326330. It merges main at 4018816 into the PR's 5c35b22 and adds one fix commit. Main has moved since; the new commits don't touch plugin or backup code, and the branch still merges cleanly.

Addressed findings

From this review:

  • Main's backup restore kept a refusal from backup time (low). A restore copies the live server's release onto each plugin installation both servers have, but it left the backup's update_failed_* columns behind. A plugin restored after it had since installed the refused version showed "Update to X failed" and counted toward Needs attention until the next update check. Fixed in b326330: pluginReleaseColumns now carries the record with the release. The extra check in TestBackupRestoreRoundTripDB fails on the merged branch without the fix and passes with it.
  • Merge conflicts with main. Two small conflicts resolved in 70e3cfd: the installation column list next to main's new WithTx, and scripts/ci/db-contracts.txt. The branch no longer changes contracts/api/v2/breaking-approvals.json because main already dropped those approvals, so I removed that line from the PR body.

From the earlier review of c25255f, fixed in 5c35b22:

  • A refusal on a plugin whose repository was deleted never cleared (medium).
  • Removing a plugin during a check failed the run (low).

Earlier threads

Left for the maintainers

These are unchanged from the last review, and I agree with leaving each one:

  • Overlapping checks. One check can clear a refusal a concurrent check just recorded. The next failing check records it again.
  • Temporary download failures are recorded as failed updates until the next check. Recording the most recent attempt seems right.
  • A plugin delisted from a catalog that is still reachable keeps its record, because the check can't tell that apart from an unreachable repository.

Verification

  • Merged tree: go build ./..., go vet on the touched packages, go test ./internal/plugins ./internal/apiv2, make lint-changed (0 issues), verify-apiv2-openapi, verify-apiv2-contract, verify-apiv2-fixtures, verify-apiv2-web-types, the web type check and pluginHelpers.test.ts pass.
  • Against a freshly migrated Postgres database: TestInstallationStoreUpdateFailureDB, TestPluginListsKeepWorkingWith* and TestBackupRestoreRoundTripDB pass.
  • The PR's own new Go tests don't build on the base, since they use the new types. The tests that fail without a fix are the two table rows added in 5c35b22 and the restore check added in b326330.
  • Not run: a live before-and-after on a server. The PR's evidence page shows the notice on the tile and page; nothing since changes what it shows.
  • CI on b326330 is still running. The two Go test failures on 5c35b22 were [bug] TestRelayMovePreservesMandatoryAudio/legacy=true flakes: checks the stop before it is sent #3361 and [bug] Subtitle reuse tests intermittently panic in a nil translator #3367, both fixed on main and now merged into this branch.

Validated features

Validation tasks: changes #1225 C1 matches the PR body. #1224 C1 is unaffected (above).

User manual

running-a-server/plugins.md covers Check for updates but not what web admin shows when an automatic update fails. I recommend a siloserver.org issue for a sentence about the notice on the tile and page and the Needs attention filter. None is open yet.

Apple and Android

No change needed. Only web admin reads plugin installations, and jellycompat has no plugin administration.

Verdict

Fit: 8/10 · Readiness: 9/10 — conditional (assuming CI is green)

  • Fit: this fills a gap 1.0 validation found, and the record lives in Postgres, so every node reports the same thing. It stays at 8 because it adds an /api/v2 field and a migration for a non-blocking polish issue.
  • Readiness: every verified defect is fixed, each with a test that fails without its fix, and the PR's evidence shows the notice live.

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

@Quick104

Quick104 commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

CI follow-up on 5c35b22: both original Go test failures reproduce on the unmodified CI base, 81ae2ce.

The affected files are unchanged between that base and CI's merge commit. I retried the failed Go test job once. Attempt 2 failed again on #3361 alone; the subtitle panic did not recur. The CI result check only propagated that Go test failure. No further identical rerun was started. Required CI remains red.

— Codex in T3 Code, gpt-6-astra

Quick104 and others added 2 commits November 9, 2026 10:25
…ease

A restore copies the live server's release columns onto each plugin
installation both servers have, but left the backup's refused-update
record in place. A restored plugin could then show "Update to X failed"
for an update from a version it no longer runs, until the next update
check cleared it. Carry the record with the release it belongs to.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

@Quick104 Quick104 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 of the branch with current main merged in. Main had moved on since 5c35b22 and the branch no longer merged cleanly, so I merged main into it (two small conflicts: the installation column list next to main's new WithTx, and scripts/ci/db-contracts.txt). Merging brought in one interaction with main's backup restore. I'm fixing it in a commit on this branch, so there's no need to change anything yourself.

A restored plugin can show a refusal for an update it no longer needs (low). CarryPluginReleases in internal/backup/plugin_releases.go, added on main by #3398, copies the live server's release columns onto each restored installation that both servers have. It doesn't copy the three new update_failed_* columns, so the row keeps the refusal from backup time while taking the live version. For example: the backup refused 2.0.0 while 1.0.0 ran, and the live server has since installed 2.0.0. After a restore the plugin runs 2.0.0 but still shows "Update to 2.0.0 failed" and counts toward Needs attention until the next update check clears it. The file isn't part of this PR's diff, so this finding has no line comment. The fix adds the three columns to pluginReleaseColumns, so the record travels with the release it describes, and extends the restore round-trip test to cover it.

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

@silo-kody

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

⚠️ Note: some checks couldn't be completed in this run, so auto-approval (when enabled) was skipped. Check the details at https://kodus.siloserver.org/pull-requests and then comment @kody review on this PR to retry once the issue is resolved.

@Quick104
Quick104 merged commit da60356 into Silo-Server:main Nov 9, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working priority: P2 Limited scope, workaround exists, or polish size/L 200–499 added + deleted lines (all files); change volume, not priority.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug] Web admin doesn't show a refused automatic plugin update on the Plugins page

2 participants