Skip to content

[stable33] fix(files): preserve encryptedVersion when copying cache entries - #62338

Merged
AndyScherzinger merged 2 commits into
stable33from
backport/62255/stable33
Jul 27, 2026
Merged

[stable33] fix(files): preserve encryptedVersion when copying cache entries#62338
AndyScherzinger merged 2 commits into
stable33from
backport/62255/stable33

Conversation

@backportbot

Copy link
Copy Markdown

Backport of PR #62255

@leftybournes
leftybournesforce-pushed the backport/62255/stable33 branch from bc07e02 to 5531957CompareJuly 24, 2026 03:49
Cache::copyFromCache() rebuilt the target's cache row via
cacheEntryToArray(), which only carried over a boolean `encrypted`
flag and dropped the real `encryptedVersion` count. Since
View::copy() unconditionally calls copyFromCache() after the storage
copy completes, this silently overwrote the correct encryptedVersion
that Encryption::updateEncryptedVersion() had just set, collapsing it
back to 0/1 on every copy of a file whose encryptedVersion was above 1.
cacheEntryToArray() now includes the source entry's encryptedVersion
when it is encrypted. The existing encrypted-to-non-encrypted-storage
override in copyFromCache() also clears encryptedVersion alongside
`encrypted`, since normalizeData() prefers encryptedVersion over
`encrypted` when both are present in the update data.
Signed-off-by: Kent Delante <kent@delante.me>
Assisted-by: ClaudeCode:claude-sonnet-5
Signed-off-by: Kent Delante <kent@delante.me>
Assisted-by: ClaudeCode:claude-sonnet-5
@DerDreschner
DerDreschnerforce-pushed the backport/62255/stable33 branch from 5531957 to ba1d172CompareJuly 25, 2026 17:35
@AndyScherzinger
AndyScherzinger merged commit cc33374 into stable33Jul 27, 2026
235 of 263 checks passed
@AndyScherzinger
AndyScherzinger deleted the backport/62255/stable33 branch July 27, 2026 18:36
@nextcloud-botnextcloud-bot mentioned this pull request Aug 10, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@leftybournes@cristianscheid@AndyScherzinger