Conversation
What was broken Newly uploaded design submissions were shown as "Malware found in submission" while antivirus scanning was still pending. Root cause The download safety helper treated virusScan: false as confirmed malware before checking that the file was still in the DMZ. The review API initializes new file submissions with that value, so pending scans displayed a false malware status until a clean scan completed. What was changed Prioritized quarantine and DMZ bucket locations before the legacy virusScan fallback. DMZ submissions now display "AV Scan in progress", while quarantine and non-DMZ failed scan behavior remains unchanged. Updated the helper documentation to describe the precedence. Any added/updated tests Added five safeForDownload unit cases covering DMZ pending, quarantine malware, the legacy failed-scan fallback, an unknown scan result, and a clean scan.
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.
What was broken
Newly uploaded design submissions could show Malware found in submission while antivirus scanning was still pending. Most warnings disappeared after the clean scan completed, while delayed or failed scans could retain the false label.
Root cause
The review API initializes every new file submission with
virusScan: falseand a DMZ URL. The community app checked the boolean first and treated it as confirmed malware before recognizing the DMZ URL as an in-progress scan.What was changed
The download-safety helper now gives known bucket locations precedence:
virusScanisfalse.The helper documentation was updated to describe the bucket precedence.
Any added/updated tests
Added five
safeForDownloadunit cases covering DMZ pending, quarantine malware, the legacy failed-scan fallback, an unknown scan result, and a clean scan.Validation completed successfully:
npm run jest -- __tests__/shared/utils/tc.js— 6 tests passed.npm test— 150 suites passed, 318 tests passed, 23 tests skipped.npm run lint— passed.npm run build— passed.