fix(api): stop swallowing document indexing errors in create handler#38192
Merged
wylswz merged 19 commits intoJul 2, 2026
Merged
Conversation
4 tasks
Contributor
Pyrefly Type Coverage
|
Contributor
Author
|
Hey, this PR is ready for review when you have a chance. Happy to adjust if anything needs changing. |
fatelei
reviewed
Jun 30, 2026
147c15f to
81192dd
Compare
…thub.com/Harsh23Kashyap/dify into fix/create-document-index-error-handling
Contributor
Author
|
Synced with latest main (behind 0). fatelei asked about logging level on the handler — switched unexpected failures to Verification: CI is mostly green; a few jobs were still finishing on the last run. Happy to adjust if you want |
# Conflicts: # web/app/components/main-nav/components/account-section.tsx
wylswz
reviewed
Jul 2, 2026
wylswz
approved these changes
Jul 2, 2026
…-index-error-handling
…-index-error-handling
…-index-error-handling
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.
Fixes #38190
Summary
The
create_document_indexevent handler wrappedIndexingRunner.runincontextlib.suppress(Exception), which swallowed every indexing failure and made the innerDocumentIsPausedErrorhandler useless for unexpected errors.This change removes the suppress wrapper and matches the logging pattern used in
document_indexing_task: log pauses at info level and log unexpected failures withlogger.exception.Test plan
cd api && uv run --group dev python -m pytest tests/unit_tests/events/event_handlers/test_create_document_index.py -q(3 passed)uv run --group dev ruff check events/event_handlers/create_document_index.py tests/unit_tests/events/event_handlers/test_create_document_index.py