Files
Stephen CuppettandClaude Opus 4.6 b6fddabf6c fix(encryption): Address review feedback and fix zero-byte size consistency
Apply come-nc's reviewer suggestions on Scanner.php:
- Simplify cached unencrypted_size skip condition to explicit == 0 check
- Remove redundant !isset guard on new-file path

Fix remaining > 0 / !== 0 guards that treated zero as "no unencrypted_size":
- FileInfo constructor: use encrypted flag for rawSize (getSize(false) path)
- FileInfo::addSubEntry: use encrypted flag for sub-mount accumulation
- Cache::calculateFolderSizeInner: use encrypted column instead of > 0

Add tests covering zero-byte encrypted file scenarios:
- FileInfoTest: getSize(true/false) for zero-byte encrypted files
- CacheTest: getUnencryptedSize and calculateFolderSize with encrypted=1,size=0
- EncryptionTest: verifyUnencryptedSize data provider cases for header-only files

Assisted-by: ClaudeCode:claude-opus-4-6
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Stephen Cuppett <scuppett@redhat.com>
2026-07-21 20:43:38 +02:00

21 KiB