fix(import): report why a manual import imported nothing - #191
Open
jordanfelle wants to merge 1 commit into
Open
jordanfelle wants to merge 1 commit into
jordanfelle wants to merge 1 commit into
Conversation
ManualImportService.Execute counted non-imported results but discarded their reasons (the decision's rejections and the result's errors), and left the command marked successful even when zero files were imported. A caller saw "Manually imported 0 files (1 failed/skipped)" with result Successful and nothing in the log to explain it. Log each non-imported file at Warn with its reasons, put the first reason in the command message, and report the command as Unsuccessful when nothing was imported. The reporter is an optional constructor argument, so existing constructions are unaffected.
jordanfelle
added a commit
to jordanfelle/chaptarr
that referenced
this pull request
Sep 26, 2026
jordanfelle
added a commit
to jordanfelle/chaptarr
that referenced
this pull request
Sep 26, 2026
jordanfelle
added a commit
to jordanfelle/chaptarr
that referenced
this pull request
Sep 26, 2026
jordanfelle
added a commit
to jordanfelle/chaptarr
that referenced
this pull request
Sep 27, 2026
jordanfelle
added a commit
to jordanfelle/chaptarr
that referenced
this pull request
Sep 27, 2026
jordanfelle
added a commit
to jordanfelle/chaptarr
that referenced
this pull request
Sep 27, 2026
jordanfelle
added a commit
to jordanfelle/chaptarr
that referenced
this pull request
Sep 27, 2026
jordanfelle
added a commit
to jordanfelle/chaptarr
that referenced
this pull request
Sep 27, 2026
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.
Problem
ManualImportService.Executecounts results that were not imported but drops their reasons (the decision'sRejectionsand the result'sErrors), and it leaves the command marked successful even when zero files were imported.Through the API this looks like:
with nothing in the log. Anything driving Manual Import through
POST /api/v1/command(scripts, integrations) cannot tell a real import from a rejected one. In practice about 89% (816 of 920) of the manual-import commands we submitted imported nothing, and we counted them as successes because the command reported success.Fix
[MANUAL-IMPORT] Not imported (Rejected) '<path>': <reasons>.Manually imported 0 files (1 failed/skipped: <reason>).Unsuccessfulwhen nothing was imported.The reporter is an optional constructor argument (
ICommandResultReporter commandResultReporter = null), so existing constructions and tests are unaffected. Partial imports keep their current result.Verification
manual_import_that_imports_nothing_should_report_unsuccessful_with_the_reason.result: unsuccessfuland... 1 failed/skipped: The authoritative author catalog does not currently contain suggested work 'hc:781589' for Ebook., with the matching Warn line in the log.