Fix profile selects sending string ids, which root folder save drops - #280
Open
beardedslav wants to merge 1 commit into
Open
beardedslav wants to merge 1 commit into
beardedslav wants to merge 1 commit into
Conversation
QualityProfileSelectInputConnector and MetadataProfileSelectInputConnector spread otherProps after their own onChange, so the parent's handler replaced the one that parses the id to a number. A profile picked from the dropdown reached state as a string, and the root folder save nulled it, failing with "A ebook quality profile is required". Fixes Chaptarr#279 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
QualityProfileSelectInputConnectorandMetadataProfileSelectInputConnectorpass their ownonChange(whichparseInts the selected id) toSelectInput, then spread{...otherProps}after it.onChangewas still inotherProps, so the parent's handler replaced the connector's, and a profile picked from the dropdown reached state as a string ("3"). The root folder save keeps only numeric ids (normalizeOptionalId), so it sentnulland the server rejected the folder with "A ebook quality profile is required".This change destructures
onChangeout ofotherPropsin both connectors, so the connector's handler is the oneSelectInputgets. Auto-selected values already went through the connector's handler, which is why only manual picks were affected.The other forms that use these selects (Edit Author, Add Author, Add Root Folder inline, import lists) pass the value straight through, and now get numbers as the connectors intended.
noneandnoChangestill pass through unchanged.Fixes #279
Database Migration
NO
How was this tested?
Built from source on macOS (
yarn build,dotnet build src/Chaptarr.sln -c Release) and run against a fresh data folder. I drove Settings → Media Management → Add Root Folder in Chromium (Playwright) and captured the request:"ebookQualityProfileId":null,"ebookMetadataProfileId":null→ 400 "A ebook quality profile is required" / "An ebook metadata profile is required"."ebookQualityProfileId":3,"ebookMetadataProfileId":2→ 201, andGET /api/v1/rootFoldershows the folder with quality profile 3.yarn typecheckpasses.yarn lintreports the same 1309 pre-existing problems before and after; none are on the changed lines. The repo has no frontend test runner, so no unit test was added.Screenshots (UI changes only)
N/A
🤖 Generated with Claude Code