Skip to content

feat: allow to disable version check#3137

Open
M0NsTeRRR wants to merge 3 commits into
developfrom
feat/disable-version-check
Open

feat: allow to disable version check#3137
M0NsTeRRR wants to merge 3 commits into
developfrom
feat/disable-version-check

Conversation

@M0NsTeRRR

@M0NsTeRRR M0NsTeRRR commented Jun 9, 2026

Copy link
Copy Markdown
Member

Description

Allow to disable version check.

How Has This Been Tested?

In local

Screenshots / Logs (if applicable)

The button
2026-06-09-132900_hyprshot

Version check enabled
2026-06-09-180230_hyprshot

Version check disabled
2026-06-09-180247_hyprshot

Checklist:

  • I have read and followed the contribution guidelines.
  • Disclosed any use of AI (see our policy)
  • I have updated the documentation accordingly.
  • All new and existing tests passed.
  • Successful build pnpm build
  • Translation keys pnpm i18n:extract
  • Database migration (if required)

Summary by CodeRabbit

  • New Features
    • Added a "Version Check" toggle in Settings (with help text); default enabled.
    • When disabled, update/commits-behind indicators are omitted and a "Version Check Disabled" badge is shown.
    • Background status polling and public status responses now respect the setting; status endpoint accepts an optional flag to skip update checks.

Signed-off-by: Ludovic Ortega <ludovic.ortega@adminafk.fr>
@M0NsTeRRR M0NsTeRRR requested a review from a team as a code owner June 9, 2026 11:50
@coderabbitai

coderabbitai Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Adds a versionCheck boolean across API, backend, and frontend. The setting defaults to true, is exposed in public settings, editable via the settings form, and used to conditionally skip update checks and omit update metadata from /status responses and UI when disabled.

Changes

Version Check Toggle

Layer / File(s) Summary
API contracts and backend interfaces
seerr-api.yml, server/interfaces/api/settingsInterfaces.ts, server/lib/settings/index.ts
OpenAPI and TypeScript interfaces add versionCheck; StatusResponse makes updateAvailable and commitsBehind optional.
Default settings initialization and exposure
server/lib/settings/index.ts, src/context/SettingsContext.tsx, src/pages/_app.tsx
Default versionCheck: true added to backend defaults, exposed via fullPublicSettings, and included in frontend initial props/context.
Settings form UI and i18n
src/components/Settings/SettingsMain/index.tsx, src/i18n/locale/en.json
Settings form initialValues and submit payload include versionCheck; adds checkbox UI and localized strings.
About section conditional badge and fetch
src/components/Settings/SettingsAbout/index.tsx
SettingsAbout conditionally fetches /api/v1/status based on versionCheck and renders a "Version Check Disabled" badge or update status badges when enabled.
Frontend status polling and display wiring
src/components/Layout/VersionStatus/index.tsx, src/components/StatusChecker/index.tsx
Components build /api/v1/status requests with checkUpdateAvailable set from settings (or false), and guard UI rendering of commitsBehind.
Status endpoint conditional update checks
server/routes/index.ts, seerr-api.yml
/status reads checkUpdateAvailable query param, instantiates Github API only when enabled, and omits updateAvailable/commitsBehind when checks are disabled.

Sequence Diagram

sequenceDiagram
  participant Frontend as Browser UI
  participant Settings as Settings Context
  participant API as /api/v1/status
  participant Github as GitHub API

  Frontend->>Settings: read currentSettings.versionCheck
  Frontend->>API: GET /api/v1/status?checkUpdateAvailable=true/false
  alt checkUpdateAvailable == true
    API->>Github: query releases/commits
    Github-->>API: release/commit info
    API-->>Frontend: status + updateAvailable + commitsBehind
  else
    API-->>Frontend: status (no updateAvailable/commitsBehind)
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested reviewers

  • gauthier-th
  • 0xSysR3ll

Poem

I nibble settings under moonlight's check,
A tiny toggle so the pings go meek,
Quiet the calls to distant release,
Let clusters update in their own peace,
🐰 A rabbit's flick keeps noise at bay.

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat: allow to disable version check' is concise and directly reflects the main objective of enabling users to disable version checking.
Linked Issues check ✅ Passed The PR implements all coding requirements from issue #1873: adds a UI setting to disable version checks, conditionally skips GitHub API calls, and omits version fields when disabled.
Out of Scope Changes check ✅ Passed All changes are directly related to implementing the version check toggle feature; no unrelated modifications detected in the codebase.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/components/Settings/SettingsMain/index.tsx (1)

213-215: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Avoid forcing a status revalidation right after turning version checks off.

On Line 214, mutate('/api/v1/status') runs unconditionally. If the user disables versionCheck, this still triggers one immediate status call right after save. Gate that mutate by values.versionCheck so opt-out takes effect immediately.

Suggested change
               mutate('/api/v1/settings/public');
-              mutate('/api/v1/status');
+              if (values.versionCheck) {
+                mutate('/api/v1/status');
+              }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/components/Settings/SettingsMain/index.tsx` around lines 213 - 215, The
unconditional call to mutate('/api/v1/status') after saving settings forces a
status revalidation even when the user turns off version checks; update the save
handler that calls mutate('/api/v1/settings/public') and
mutate('/api/v1/status') to only call mutate('/api/v1/status') when
values.versionCheck is true (i.e., gate the second mutate by checking
values.versionCheck) so that opting out of versionCheck takes effect
immediately.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@seerr-api.yml`:
- Around line 253-255: The OpenAPI schema's example for the boolean property
versionCheck conflicts with the runtime default (initialized as true); update
the schema example for versionCheck from false to true so the example aligns
with the actual initialized default and avoids misleading API consumers (locate
the versionCheck property in the schema and change its example value).

In `@src/components/StatusChecker/index.tsx`:
- Around line 26-31: The current useSWR call disables all /api/v1/status polling
when settings.currentSettings.versionCheck is false which prevents
data.restartRequired from updating; change the client to always poll a
lightweight restart-status endpoint (or always fetch the restart flag) instead
of passing null when versionCheck is off — e.g., keep useSWR for restart status
regardless of settings.currentSettings.versionCheck (call a dedicated endpoint
like '/api/v1/status/restart' or always request '/api/v1/status' but have the
backend short-circuit the GitHub check while still returning restartRequired).
Update references around useSWR, settings.currentSettings.versionCheck,
'/api/v1/status' and data.restartRequired to use the new endpoint/logic so
restart-required modals continue to work even when versionCheck is disabled.

In `@src/context/SettingsContext.tsx`:
- Around line 34-35: The settings selection currently falls back to
defaultSettings whenever an SWR error exists, which can overwrite valid
stale/fallback data (e.g., flipping versionCheck). In SettingsContext.tsx update
the selection logic that uses error to choose defaultSettings so it instead
prefers any available SWR data/fallback (the `data` returned from useSWR or its
`fallbackData`) before falling back to `defaultSettings`; adjust the code around
the variables `data`, `error`, and `defaultSettings` (and the final
`settings`/`versionCheck` value) so stale data is used when present even if
`error` is truthy.

---

Outside diff comments:
In `@src/components/Settings/SettingsMain/index.tsx`:
- Around line 213-215: The unconditional call to mutate('/api/v1/status') after
saving settings forces a status revalidation even when the user turns off
version checks; update the save handler that calls
mutate('/api/v1/settings/public') and mutate('/api/v1/status') to only call
mutate('/api/v1/status') when values.versionCheck is true (i.e., gate the second
mutate by checking values.versionCheck) so that opting out of versionCheck takes
effect immediately.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: bbb2bdbf-960d-4a02-b525-74eca6c885f5

📥 Commits

Reviewing files that changed from the base of the PR and between 6e9ba06 and 3c99cf2.

📒 Files selected for processing (10)
  • seerr-api.yml
  • server/interfaces/api/settingsInterfaces.ts
  • server/lib/settings/index.ts
  • src/components/Layout/VersionStatus/index.tsx
  • src/components/Settings/SettingsAbout/index.tsx
  • src/components/Settings/SettingsMain/index.tsx
  • src/components/StatusChecker/index.tsx
  • src/context/SettingsContext.tsx
  • src/i18n/locale/en.json
  • src/pages/_app.tsx

Comment thread seerr-api.yml
Comment thread src/components/StatusChecker/index.tsx
Comment thread src/context/SettingsContext.tsx
@M0NsTeRRR M0NsTeRRR requested a review from gauthier-th June 9, 2026 16:04

@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

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/components/Layout/VersionStatus/index.tsx`:
- Around line 73-89: The JSX currently uses a truthy check "{data.commitsBehind
&& (...)}" which hides the valid 0 state; update the guard in the VersionStatus
component to check for presence (e.g., data.commitsBehind !== undefined &&
data.commitsBehind !== null or Number.isFinite(data.commitsBehind)) instead of
truthiness so that commitsBehind === 0 still renders the inner span and the
subsequent branches that use data.commitTag,
intl.formatMessage(messages.commitsbehind), messages.outofdate, and data.version
are evaluated correctly.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 1617203a-4ca5-49c9-810f-a35fcce52f44

📥 Commits

Reviewing files that changed from the base of the PR and between 3c99cf2 and 729a892.

📒 Files selected for processing (5)
  • seerr-api.yml
  • server/interfaces/api/settingsInterfaces.ts
  • server/routes/index.ts
  • src/components/Layout/VersionStatus/index.tsx
  • src/components/StatusChecker/index.tsx

Comment thread src/components/Layout/VersionStatus/index.tsx Outdated
Signed-off-by: Ludovic Ortega <ludovic.ortega@adminafk.fr>
@M0NsTeRRR M0NsTeRRR force-pushed the feat/disable-version-check branch from 729a892 to 55cd7b3 Compare June 9, 2026 16:14
gauthier-th
gauthier-th previously approved these changes Jun 18, 2026
Comment thread server/routes/index.ts Outdated
@seerr-automation-bot seerr-automation-bot added this to the v3.4.0 milestone Jun 18, 2026
Signed-off-by: Ludovic Ortega <ludovic.ortega@adminafk.fr>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Capability to disable version check

3 participants