Repository navigation
Conversation
32 of 34 tasks
chenyme
self-requested a review
October 31, 2026 09:10
chenyme
approved these changes
Oct 31, 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.
Summary
Fixes #903.
A successfully extracted PDF can show a failure reason in More information even though the database has no processing error. Keep error-free file responses empty instead of manufacturing an extraction failure.
Reproduction
Actual behavior
The API returns a PDF extraction-failure message despite the successful state and empty stored error fields. More information renders that message as the failure reason.
Expected behavior
Files without processing errors retain an empty error message. Genuine failures continue to receive the existing safe explanation.
Root cause and approach
HumanizeFileProcessingError is a failure formatter: an empty code defaults to extract_failed. Response mapping called it unconditionally, including for successful, queued and empty files.
Add ResolveFileProcessingErrorMessage at the response boundary. It returns an empty message when the status is not failed and both error fields are empty after trimming. Otherwise it delegates to the existing formatter. Use it in the application status mapper and both HTTP response mappers.
The extraction pipeline and persisted records are unchanged. This also fixes existing successful records when they are read again.
Change type
Affected areas
Verification
All Go commands ran in backend with Go 1.26.10 and SQLite development headers.
Regression coverage includes PDF, document and image states; queued/extracting/embedding/ready states; whitespace-only fields; empty documents; independent embedding failures; legacy failures; coded failures; and safe handling of raw diagnostics.
Screenshots, API examples, or logs
Synthetic ready-PDF response before the fix:
processingStatus: ready
extractStatus: ready
processingErrorCode: ""
processingErrorMessage: "PDF 未提取到可读文本。该文件可能是扫描件、图片型 PDF、加密 PDF,或文档内容本身不可复制。"
After the fix, processingErrorMessage is empty. Processing-status responses likewise keep errorMessage empty.
The original Windows/MinerU upload was not replayed. This fixes the response inconsistency; it does not establish why the report's first PDF failed extraction.
Configuration, migration, and compatibility notes
No configuration change, database migration or data rewrite. No response fields are added or removed. Files with actual errors retain their safe failure messages.
Documentation
Security and privacy
Checklist