fix: skip rescan-on-download when no malware scanner is bound#783
Merged
Schmarvinius merged 3 commits intomainfrom Apr 10, 2026
Merged
fix: skip rescan-on-download when no malware scanner is bound#783Schmarvinius merged 3 commits intomainfrom
Schmarvinius merged 3 commits intomainfrom
Conversation
Contributor
There was a problem hiding this comment.
The PR is well-structured and the core logic change is correct. The only notable issue is the repeated construction of handlerWithoutScanner across three test methods, which should be refactored into a shared helper to reduce duplication and improve maintainability. The production code changes in ReadAttachmentsHandler and Registration are clean and correctly implement the intended behavior.
PR Bot Information
Version: 1.20.4 | 📖 Documentation | 🚨 Create Incident | 💬 Feedback
- LLM:
anthropic--claude-4.6-sonnet - Event Trigger:
pull_request.opened - File Content Strategy: Full file content
- Correlation ID:
9c915e60-33f6-11f1-8c2d-1502b3e0d84c
lisajulia
approved these changes
Apr 10, 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.
Fix: Skip Rescan-on-Download When No Malware Scanner Is Bound
Bug Fix
🐛 Fixed an issue where the
ReadAttachmentsHandlerwould attempt to trigger rescan-on-download logic even when no malware scanner service is bound. WhenscanClientisnull(i.e., no malware scanning service is available), stale or unscanned attachments should not be queued for rescanning on download.Changes
Registration.java: PassesscanClient != nullas thescannerAvailableflag when constructingReadAttachmentsHandler, ensuring the handler is aware of whether a malware scanner is actually bound.ReadAttachmentsHandler.java: Added ascannerAvailableboolean field and updated the constructor to accept it. TheverifyStatusmethod now short-circuits the rescan check whenscannerAvailableisfalse, preventing unnecessary scan attempts when no scanner is configured.ReadAttachmentsHandlerTest.java: Updated the existing handler instantiation to passtrueforscannerAvailable. Added three new test cases covering thescannerAvailable = falsescenario:nullscannedAttimestamp are not re-triggered.UNSCANNEDstatus still fail validation as expected (status validation is unaffected by scanner availability).📬 Subscribe to the Hyperspace PR Bot DL to get the latest announcements and pilot features!
PR Bot Information
Version:
1.20.4| 📖 Documentation | 🚨 Create Incident | 💬 Feedbackanthropic--claude-4.6-sonnetpull_request.opened9c915e60-33f6-11f1-8c2d-1502b3e0d84c