Repository navigation
Commit 57df4d8
fix(files): preserve encryptedVersion when copying cache entries
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-51 parent 2077c1e commit 57df4d8
1 file changed
Lines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1166 | 1166 | | |
1167 | 1167 | | |
1168 | 1168 | | |
| 1169 | + | |
| 1170 | + | |
| 1171 | + | |
1169 | 1172 | | |
1170 | 1173 | | |
1171 | 1174 | | |
| |||
1199 | 1202 | | |
1200 | 1203 | | |
1201 | 1204 | | |
| 1205 | + | |
| 1206 | + | |
| 1207 | + | |
| 1208 | + | |
| 1209 | + | |
1202 | 1210 | | |
1203 | 1211 | | |
1204 | 1212 | | |
| |||
0 commit comments