Skip to content

chore: suppress error in search upload handler for file type not found#2345

Merged
gbirman merged 2 commits intomainfrom
gab/chore/suppress-no-file-type-found-error-search
Apr 2, 2026
Merged

chore: suppress error in search upload handler for file type not found#2345
gbirman merged 2 commits intomainfrom
gab/chore/suppress-no-file-type-found-error-search

Conversation

@gbirman
Copy link
Copy Markdown
Contributor

@gbirman gbirman commented Apr 2, 2026

not an error, we should just exit early

@gbirman gbirman requested a review from a team as a code owner April 2, 2026 14:44
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 2, 2026

📝 Walkthrough

Summary by CodeRabbit

  • Bug Fixes
    • Improved robustness of file upload processing when file type information is unavailable. The system now handles this scenario gracefully by logging a trace message and continuing with remaining processing steps, rather than halting with an error. All other processing workflows including event parsing, document retrieval, and message transmission remain unchanged.

Walkthrough

Modified the handler to treat missing file_type as a non-error by matching on document_basic.try_file_type(), logging a trace message, and returning Ok(()) when None is encountered, instead of propagating an error via ?.

Changes

Cohort / File(s) Summary
Handler Error Handling
rust/cloud-storage/search_upload_handler/src/handler.rs
Changed error handling for missing file_type field. Now matches on try_file_type() result and returns early with trace log when None, instead of propagating error. Other control flow (event parsing, document lookup, SQS message sending) unchanged.
🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title follows conventional commits format (chore:) and is 70 characters, meeting the requirement to be under 72 characters and using proper formatting.
Description check ✅ Passed The description relates to the changeset by explaining the rationale for treating missing file_type as non-error, matching the pull request's intent to exit early rather than propagate an error.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@rust/cloud-storage/search_upload_handler/src/handler.rs`:
- Around line 52-58: The current handling of try_file_type() conflates two
cases; update the logic to inspect document_basic.file_type directly before
calling try_file_type(): if document_basic.file_type is None, keep the tracing
behavior (tracing::trace!(document_id=?document_id, "no file type found") and
return Ok(())); if document_basic.file_type is Some(_) but try_file_type()
returns None, log a warning (tracing::warn!(document_id=?document_id,
"unrecognized file type", file_type=?document_basic.file_type)) to surface
data-quality issues, then return Ok(())—use the existing functions
try_file_type(), document_basic.file_type, and document_id to locate and
implement this change.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: b1457a3e-d71c-4161-b25a-3523b2253b13

📥 Commits

Reviewing files that changed from the base of the PR and between 0a80c11 and 61849a2.

⛔ Files ignored due to path filters (1)
  • rust/cloud-storage/target/lambda/search_upload_handler/bootstrap.zip is excluded by !**/*.zip, !**/target/**
📒 Files selected for processing (1)
  • rust/cloud-storage/search_upload_handler/src/handler.rs

@gbirman gbirman merged commit edbf366 into main Apr 2, 2026
39 checks passed
@gbirman gbirman deleted the gab/chore/suppress-no-file-type-found-error-search branch April 2, 2026 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant