Feat/allow switching between windows defender and clamav#927
Feat/allow switching between windows defender and clamav#927
Conversation
egalvis27
commented
Jul 24, 2025
- Antivirus Scan: Scans now use the Antivirus Manager to select the most suitable antivirus engine.
- Removed Checks: Eliminated validations related to Windows Defender real-time protection.
- Refactored Initialization: Updated initializeAntivirus to include payment conditions before initializing the antivirus engine.
…nce engine selection logic
… and improve active engine management
…into feat/create-antivirus-manager
…g-between-windows-defender-and-clamav
…rusManager function
…g-between-windows-defender-and-clamav
…ternxt/drive-desktop into feat/create-antivirus-manager
…g-between-windows-defender-and-clamav
… unused imports and promises
…g-between-windows-defender-and-clamav
…treamline availability checks
…g-between-windows-defender-and-clamav
Coverage Report
File CoverageNo changed files found. |
| @@ -0,0 +1,14 @@ | |||
| import { exec } from 'child_process'; | |||
There was a problem hiding this comment.
Can you check the usage of import { promisify } from 'util'. I think is going to be easier to execute exec without using callbacks and new Promise.
const exec = promisify(execCallback);
…v' of https://github.com/internxt/drive-desktop into feat/allow-switching-between-windows-defender-and-clamav
… with logger and update types for clarity
…initialization and availability checks
…ucts and enablement status
| return 'clamav'; | ||
| } | ||
| if (!clamavAvailable) await initializeClamAV(); | ||
| if (await checkClamdAvailability()) { |
There was a problem hiding this comment.
You don't need to do this check again, just read the result value from initializeClamAV
There was a problem hiding this comment.
Following your recommendation this morning, I kept only one validation. After running some tests, I noticed that ClamAV was never selected as the antivirus engine. This is because when the full antivirus interface is initialized, ClamAV gets loaded. But with just the negated condition remaining, the code never enters the block that returns ClamAV as the engine to be used.
| this.isInitialized = true; | ||
| } catch (error) { | ||
| console.error('Error Initializing ClamAV:', error); | ||
| logger.error({ |
There was a problem hiding this comment.
You can do throw logger.error so we can have the stack trace using the msg of the logger error
|

