Skip to content

fix(requests): avoid saving advanced request defaults as overrides - #3477

Open
fallenbagel wants to merge 1 commit into
developfrom
fix/anime-root-folder-override-detection
Open

fix(requests): avoid saving advanced request defaults as overrides#3477
fallenbagel wants to merge 1 commit into
developfrom
fix/anime-root-folder-override-detection

Conversation

@fallenbagel

@fallenbagel fallenbagel commented Sep 5, 2026

Copy link
Copy Markdown
Member

Description

The advanced request form fills its dropdowns with the defaults for the server it is about to use and submits them regardless of whether the user touched anything, so every request made with advanced permissions stores a root folder, quality profile, language profile and tags. Once stored, those values are indistinguishable from a deliberate override when the request is sent on, and anything stored before an anime root folder was configured then wins over it for good. Turning on anime routing does nothing for requests that already existed, and editing one of them writes the stale value straight back.

The form now submits a field only when the selection differs from the default it
presented, so a request carries an override only where the user actually chose something else, and reverting a field back to the default on an existing request clears it rather than leaving the old value behind. Requests made before this still carry whatever was stored at the time. Since a series keeps the folder it was given when it was first added, there is nothing to correct for anything already sent.

Note

Requests still pending or unapproved when this ships may still carry a stale stored value until they're next edited, which resubmits them through the fixed form and clears it. Anything already added to Sonarr is unaffected either way, since addSeries never rewrites rootFolderPath on an existing series.

How Has This Been Tested?

Tested via the unit tests attached but should work manually too by:

  • Requesting an anime series without touching the dropdowns and confirming that it lands in the anime root folder

Screenshots / Logs (if applicable)

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

  • Bug Fixes

    • Clearing profile, folder, language, or tag selections when editing a request now correctly removes previously saved overrides.
    • Request forms more accurately distinguish between server defaults and user-selected overrides.
    • Anime TV requests now use configured anime defaults while honoring saved custom folder and profile settings.
  • Tests

    • Added coverage for clearing request overrides and routing anime requests with default and custom settings.

@fallenbagel
fallenbagel requested a review from a team as a code owner September 5, 2026 22:31
@coderabbitai

coderabbitai Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Team

Run ID: aadd02a8-974e-4970-b552-26072a59f032

📥 Commits

Reviewing files that changed from the base of the PR and between 25f8cb4 and 6b41cce.

📒 Files selected for processing (1)
  • src/components/RequestModal/AdvancedRequester/index.tsx

Included review availability: Your plan provides up to 10 included reviews per hour; 6 remain after this review.


📝 Walkthrough

Walkthrough

The request modal omits server-default overrides. The request edit handler clears omitted override fields to null. Subscriber tests cover Sonarr anime defaults and stored standard overrides.

Changes

Request override handling

Layer / File(s) Summary
Requester default propagation
src/components/RequestModal/AdvancedRequester/index.tsx
Server defaults are memoized and used to omit matching profile, folder, language, and tag overrides.
Request edit override clearing
server/routes/request.ts, server/routes/request.test.ts
Absent movie and TV override fields are stored as null. A movie test verifies that a second PUT clears prior overrides.
Sonarr anime routing coverage
server/subscriber/MediaRequestSubscriber.test.ts
Tests configure Sonarr and mock dependencies, then verify anime defaults and stored standard directory and profile overrides.

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

Merge Risk: ⚪ Minimal · up to 6b41c

Advanced request settings now omit selections matching the active server defaults and clear obsolete overrides when requests are edited. The updated default synchronization prevents anime routing changes from retaining standard selections as overrides, with no remaining merge-blocking risk.

Suggested reviewers: 0xsysr3ll, gauthier-th

Poem

A rabbit trims defaults with care
Matching tags now vanish in air
Empty fields turn null below
Anime paths know where to go
Tests hop neatly, row by row

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: preventing advanced request defaults from being stored as overrides.

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.

coderabbitai[bot]

This comment was marked as resolved.

…rrides

The advanced request form submists whatever sits in its dropdowns, so every request made with
advanced permissions saved a root folder, quality profile, language profile and tags even when the
user changed nothing. A value saved that way is later read back as a deliberate override, which is
what defeats the anime root folder once one is configured. The form now submits a field only when
the selection differs from the default it presented, and reverting a field on an existing request
clears it instead of leaving the previous value behind.
@fallenbagel
fallenbagel force-pushed the fix/anime-root-folder-override-detection branch from 25f8cb4 to 6b41cce Compare September 5, 2026 23:04
@fallenbagel fallenbagel changed the title fix(requests): stop advanced request defaults from being saved as overrides fix(requests): avoid saving advanced request defaults as overrides Sep 5, 2026
@fallenbagel fallenbagel changed the title fix(requests): avoid saving advanced request defaults as overrides fix(advanced-requests): avoid saving request defaults as overrides Sep 5, 2026
@fallenbagel fallenbagel changed the title fix(advanced-requests): avoid saving request defaults as overrides fix(requests): avoid saving advanced request defaults as overrides Sep 5, 2026
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.

1 participant