[stable34] fix(encryption): Correctly report size for zero-byte encrypted files - #62780
Open
backportbot[bot] wants to merge 3 commits into
Open
[stable34] fix(encryption): Correctly report size for zero-byte encrypted files#62780backportbot[bot] wants to merge 3 commits into
backportbot[bot] wants to merge 3 commits into
Conversation
Files with 0 bytes no longer incorrectly report as 8192 bytes. Widens unencryptedSize to ?int, fixes verifyUnencryptedSize to compare against header size instead of 0, and corrects Scanner to populate unencrypted_size on initial upload. Assisted-by: ClaudeCode:claude-opus-4-6 Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Stephen Cuppett <steve@cuppett.com>
…stency 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>
…Byte Add a second encrypted child with unencrypted_size=100 so the write-back gate in calculateFolderSizeInner ($unencryptedMax > 0) actually opens. The original single zero-byte child left the gate closed, meaning the test passed against the DB default rather than the computed value. With two children the assertion distinguishes the fixed code (result: 100) from the old buggy code (result: 8292, falling back to on-disk size for the zero-byte child). Assisted-by: ClaudeCode:claude-opus-4-6 Signed-off-by: Stephen Cuppett <scuppett@redhat.com>
backportbot
Bot
requested review from
come-nc,
cuppett,
icewind1991,
leftybournes,
miaulalala,
nfebe and
sorbaugh
and removed request for
a team
August 3, 2026 09:28
cuppett
enabled auto-merge
August 3, 2026 11:10
come-nc
approved these changes
Aug 3, 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.
Backport of PR #60070