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
refactor(notifications): fix the processing settings in code - #4596
Related issue: N/A
Validation tasks: none changed. #1234 C1 (delivery through every channel) runs through this code; delivery behaves the same.
Other clients: Apple N/A (no admin settings screen); Android N/A (no admin settings screen); Roku N/A (no admin settings screen)
The admin Notifications page has a Processing section with seven settings nobody needs to tune: switches that stop recording new content and stop matching it to people, the fanout settle window, the 72-hour content age limit, and the read, unread, and sent-history retention windows. An admin who turns a switch off silently stops every notification channel. This change fixes all seven in code at their current values, removes the section and its "paused" banner, and deletes any stored values. A server that had switched notifications off will start notifying again after upgrading.
This is the processing-settings part of #2884, split out and redone on current main. #2884's push cooldown is not ported: the Next Up rule from #4409 replaced it.
Approach
The settings become constants in internal/notifications. A Goose migration deletes their server_settings rows. The admin defaults, the per-key validation, and the backup restore guard drop the keys, and a selective restore from an older backup skips them.
The notification docs now match the code in four places: the webhook HMAC key is the signing secret string as returned, the generic payload carries library_id, an invalid relay_url is a 400, and webhook update accepts If-Match: *.
Not included: #2884's claim tie-break by episode, which the Next Up rule makes unnecessary (one ingest commits all its events together, so a lower episode is always listed before a higher one is evaluated), and its shared channel-outbox refactor, which is a separate concern.
Validation
Go: build, gofmt, go mod tidy -diff, go vet, make lint-changed (0 issues), and make lint-router-recovery pass.
internal/notifications, internal/backup and internal/config tests pass against a scratch Postgres migrated from this branch.
Web: lint, format check, build, bundle budget, and the admin-settings and search vitest suites pass.
Settings bindings, route inventory, OpenAPI, web types, the v2 contract comparison, local paths, case collisions, size ratchet, bidi, and migrations checks pass.
Not run locally: the full make test-go and make test-web, make verify-actionlint, make verify-shellcheck, make verify-prometheus-rules, playback fixtures, and v2 fixtures. CI runs them; this change touches no workflow, shell script, playback, or API contract.
On an isolated test server, first built from main with notifications switched off and read retention set to 45 days: the page showed the "Sending is paused" banner and the Processing section. After rebuilding from this branch, the migration removed both stored values, and the page has no banner and no Processing section, on desktop and phone widths. The browser console showed no errors either way.
On PostgreSQL 18 at 541a02a3d8, a database upgrade from main with fanout paused and a seven-day event window left two queued episode events for the worker. The 71-hour-old event produced one inbox delivery. The 73-hour-old event was marked stale and produced none.
Risks
Upgrading resumes both recording and processing. If a server kept recording release events while fanout was paused, already queued events up to 72 hours old can generate notifications for eligible recipients through enabled channels. Events never recorded while capture was off are not replayed.
The 72-hour limit applies to the existing queue, including servers that previously allowed a longer window. Fanout suppresses older queued episode events without creating an inbox delivery. This cutoff uses the time the event was recorded.
At the next daily retention run, servers that previously kept inbox notifications longer lose read notifications older than 90 days and unread notifications older than 180 days. Include these upgrade effects in the release notes. The user manual issue is docs: notification Processing settings are gone siloserver.org#276.
The migration only deletes rows. Its Down step restores nothing, and the defaults apply either way.
Checklist
I read and can explain the complete diff.
This pull request addresses one concern.
Each test this pull request adds meets "Decide what to test" in CONTRIBUTING.md.
The Evidence section shows every change a user can see, or how I checked a change nobody sees.
AI Disclosure
Harness: Claude Code, running in T3 Code
Tool(s): Claude Code
Model(s): claude-opus-5-5
Involvement: Fully AI-generated at the maintainer's direction; maintainer review pending
Adversarial review: gpt-6.2-sol (Codex), reviewed 256c139, four findings. Fixed: selective restore no longer offers the retired keys, the relay_url status doc, and the optional library_id doc. Answered: the plugin task help text comes from the catalog release ahead of feat(plugins): apply plugin task bindings and lifecycle changes live #3611, not from this change.
Remove configurable notification processing settings and fix values in code
Notification processing and retention settings are no longer configurable. Fixed values replace them: 30-second fanout settle delay, 72-hour stale-event cutoff (maxReleaseEventAge), and 90/180/30-day retention for read, unread, and release-event records in system_retention.go and fanout_worker.go
Removes the FanoutEnabled and ReleaseEventsEnabled switches: FanoutWorker.Run now always processes, and AvailabilityDetector.runKind no longer checks a release-events setting in availability_detector.go
Removes the Processing settings group, paused-pipeline message, and related search terms from the admin UI (NotificationsAdminSettings.tsx) and drops the corresponding translations from all locale catalogs
Behavioral Change: fanout and release-event recording are always on; the Down migration does not restore deleted setting rows; stale events are cut off at a fixed 72 hours regardless of prior configuration
The Processing section of the admin Notifications page exposed settings
with working defaults that nobody needs to tune: the two pipeline kill
switches, the fanout settle window, the 72-hour staleness horizon, and
the read, unread, and release-event retention windows. They become
constants at their current values, the section and its paused banner go
away, and a migration deletes any stored values. A server that had
switched the pipeline off will notify again.
The 30-second settle delay stays: the Next Up rule reads which episodes
the catalog lists when fanout runs, and the delay keeps files imported
one at a time close together in episode order.
The notification docs also now match the code on webhook HMAC keys, the
generic payload's library_id, relay_url validation, and If-Match: * on
webhook update.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Notification processing settings were removed from configuration, persistence, and the admin interface. Notification workers now use fixed settle, stale-event, and retention windows. Documentation and translation catalogs were updated to reflect these changes and related notification API details.
The seven processing settings are removed from defaults, normalization, access classifications, and selective restore. The migration deletes their stored rows. The backup test now checks that notifications.ui_enabled retains the stricter live value.
Use fixed notification timing and retention internal/notifications/availability_detector.go, internal/notifications/fanout_worker.go, internal/notifications/release_types.go, internal/notifications/server_channel_worker.go, internal/notifications/system.go, internal/notifications/system_retention.go, internal/notifications/recipient_access_db_test.go
The availability detector uses seeded state to decide whether to emit events. Fanout uses a fixed 30-second settle delay and fixed stale-event age. Retention uses fixed windows of 90 days for read deliveries, 180 days for unread deliveries, and 30 days for processed events.
Remove processing controls from the admin interface web/src/pages/admin-settings/NotificationsAdminSettings.tsx, web/src/lib/adminSettingsSearch.ts, web/src/locales/*.json, web/src/locales/keys.ts, .silo-translations
The admin page and its search registry no longer expose notification processing controls. Locale catalogs and generated translation keys remove the related labels and descriptions. The translation version and checksum are updated.
The documentation describes fixed timing and retention, updated webhook payload and signing details, relay error outcomes, and If-Match: * behavior for existing webhook rows.
The notification documentation slightly overstates what the 30-second settle delay guarantees. This is a small wording fix, and no functional problem remains in the change.
Architecture risk: Low · up to f9911
The change affects 4 systems.
Changed systems:web, internal, docs, migrations
Architecture concerns
No architecture-level concerns identified.
Review details
Systems and components
observed — web (service) was modified; 44 changed files map to changed impact.
observed — internal (service) was modified; 12 changed files map to changed impact.
observed — docs (service) was modified; 2 changed files map to changed impact.
observed — migrations (service) was modified; 1 changed file maps to changed impact.
Before / after behavior
observed — Modified behavior in docs/architecture/notifications.md: The documentation now describes released_at as set for a seeded-library release recorded within the window, omitting the prior statement that it is set even when release events are turned off.
observed — Modified behavior in docs/architecture/notifications.md: The documented stale-event suppression horizon is now explicitly 72 hours; the previous text described extended downtime or disabled fanout without specifying a duration.
observed — Modified behavior in docs/architecture/notifications.md: The documentation replaces a configurable settle delay, with a 30-second default, with a fixed 30-second delay. It adds that episodes imported separately within that window are listed before evaluation, allowing the earlier listed episode to notify even when it arrives after another episode.
observed — Modified behavior in docs/architecture/notifications.md: The documentation adds daily retention windows: 90 days for read deliveries, 180 days for unread deliveries, 30 days for processed release events, and deletion of unprocessed events past the 72-hour staleness horizon.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title "refactor(notifications): fix the processing settings in code" matches the main change: the seven notification processing settings are turned into fixed code constants, removed from admin se…
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 explains removing the Processing section of the admin Notifications page, fixing seven notification processing settings in code (30-second settle delay,…
Full details: Title check
Explanation
The title "refactor(notifications): fix the processing settings in code" matches the main change: the seven notification processing settings are turned into fixed code constants, removed from admin settings, and dropped from the database via migration. It is specific, though the word "fix" is slightly ambiguous since the change is not a bug fix.
Full details: Description check
Explanation
The description is related to the changeset. It explains removing the Processing section of the admin Notifications page, fixing seven notification processing settings in code (30-second settle delay, 72-hour stale-event cutoff, 90/180/30-day retention), adding a migration that deletes the stored rows, and updating notification docs. It also gives validation steps and risks. The description is specific and on-topic, so the check passes.
Finishing Touches
Generate unit tests (beta)
Commit to this branch
Create a new PR
Fix failing CI checks
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
A backup from before the processing settings were fixed in code still
holds their rows, and the catch-all notifications. classification offered
them for restore. Selective restore now skips the seven retired keys.
The notification docs also say that a malformed relay_url is a 422 and a
rejected relay origin a 400, and that request notifications leave out
library_id.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
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 settingsReview Options
The following review options are enabled or disabled:
Options
Enabled
Bug
✅
Performance
✅
Security
✅
Business Logic
❌
⚠️ 4 Kody Rule(s) were not evaluated
These rules declare that they need repository context beyond this diff, and the review could not retrieve it, so they were not judged on this pull request:
Preserve optional store capabilities through production wrappers
Detach mandatory cleanup from request cancellation and bound its lifetime
Preserve durable media identity and share identity-evidence precedence
Bound decoder throughput trades and share direct-play eligibility
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.
The previous run could not post its finding. The incremental retry skipped this commit because no files had changed. Please run a fresh review of 541a02a.
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
priority: P2Limited scope, workaround exists, or polishsize/XXXL3000+ added + deleted lines (all files); change volume, not priority.
1 participant
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 changed. #1234 C1 (delivery through every channel) runs through this code; delivery behaves the same.
Other clients: Apple N/A (no admin settings screen); Android N/A (no admin settings screen); Roku N/A (no admin settings screen)
The admin Notifications page has a Processing section with seven settings nobody needs to tune: switches that stop recording new content and stop matching it to people, the fanout settle window, the 72-hour content age limit, and the read, unread, and sent-history retention windows. An admin who turns a switch off silently stops every notification channel. This change fixes all seven in code at their current values, removes the section and its "paused" banner, and deletes any stored values. A server that had switched notifications off will start notifying again after upgrading.
This is the processing-settings part of #2884, split out and redone on current
main. #2884's push cooldown is not ported: the Next Up rule from #4409 replaced it.Approach
internal/notifications. A Goose migration deletes theirserver_settingsrows. The admin defaults, the per-key validation, and the backup restore guard drop the keys, and a selective restore from an older backup skips them.library_id, an invalidrelay_urlis a 400, and webhook update acceptsIf-Match: *.Not included: #2884's claim tie-break by episode, which the Next Up rule makes unnecessary (one ingest commits all its events together, so a lower episode is always listed before a higher one is evaluated), and its shared channel-outbox refactor, which is a separate concern.
Validation
gofmt,go mod tidy -diff,go vet,make lint-changed(0 issues), andmake lint-router-recoverypass.internal/notifications,internal/backupandinternal/configtests pass against a scratch Postgres migrated from this branch.make test-goandmake test-web,make verify-actionlint,make verify-shellcheck,make verify-prometheus-rules, playback fixtures, and v2 fixtures. CI runs them; this change touches no workflow, shell script, playback, or API contract.Evidence
Evidence: https://evidence.siloserver.org/r/silo-server/pr-4596/
On an isolated test server, first built from
mainwith notifications switched off and read retention set to 45 days: the page showed the "Sending is paused" banner and the Processing section. After rebuilding from this branch, the migration removed both stored values, and the page has no banner and no Processing section, on desktop and phone widths. The browser console showed no errors either way.On PostgreSQL 18 at
541a02a3d8, a database upgrade from main with fanout paused and a seven-day event window left two queued episode events for the worker. The 71-hour-old event produced one inbox delivery. The 73-hour-old event was markedstaleand produced none.Risks
Checklist
AI Disclosure
🤖 Generated with Claude Code
Note
Remove configurable notification processing settings and fix values in code
maxReleaseEventAge), and 90/180/30-day retention for read, unread, and release-event records in system_retention.go and fanout_worker.goFanoutEnabledandReleaseEventsEnabledswitches:FanoutWorker.Runnow always processes, andAvailabilityDetector.runKindno longer checks a release-events setting in availability_detector.goserver_settings(remove_notification_processing_settings.sql), andRestorableSettingrejects these keys during backup restore in restore_settings.goMacroscope summarized 541a02a.