Fix malware scan status stuck at Scanning after draft activation#771
Fix malware scan status stuck at Scanning after draft activation#771Schmarvinius wants to merge 2 commits intomainfrom
Conversation
SummaryThe following content is AI-generated and provides a summary of the pull request: Fix Malware Scan Status Stuck at
|
There was a problem hiding this comment.
The PR introduces a two-phase scan-then-update-all-entities approach to fix a real race condition, but has several substantive correctness issues: the unconditional "update all" loop can stamp unrelated attachments that appear between SELECT and UPDATE; findAndScanAttachment relies on re-reading an already-iterated Result object whose re-readability is untested; and a test's name/assertions directly contradict its intent, obscuring the actual behaviour under review.
PR Bot Information
Version: 1.19.9 | 📖 Documentation | 🚨 Create Incident | 💬 Feedback
- File Content Strategy: Full file content
- Correlation ID:
d3dddd80-2c4e-11f1-9772-da3e87f9e8b3 - Event Trigger:
pull_request.opened - LLM:
anthropic--claude-4.6-sonnet
Summary
status: ScanningforeverCloses #770
Root Cause
scanAttachment()selected the attachment row before the scan, then updated the same entity after the scan. If the draft was activated during the scan, the draft row was deleted and the update hit 0 rows. The active entity was skipped because it had 0 rows at select time.Fix
Split
scanAttachment()into two phases:An UPDATE against a table with no matching row is a harmless 0-row no-op. The table that has the row gets updated.