0
0
Fork 0
mirror of https://github.com/nextcloud/server.git synced 2025-05-02 13:00:42 +00:00
nextcloud_server/apps/files_versions
Ferdinand Thiessen 5e03c6fb58
fix(files_versions): create version if previous does not exist
This issue happens reproducible if:
- Versions is disabled
- Upload a file
- Enable versions
- Upload same file unchanged
- Now the error happens.

Problem is that the mtime is unchanged so no version will be created on the upload, but it tries to update the last version which does not exists.
Instead of "upload same file unchanged" you can also - like in the example stack trace above - use Android with an SD card with invalid mtime -> the mtime will be stripped so its always the same.
Instead of disable versions the same also happens if e.g. the versions creation failed due to other issues.

The solution now is to catch the exception and create if not exists.
A cleaner solution would be to have a method on the versions backend
like `hasVersionEntity(File $file, int $revision): bool` but this would
be a breaking change or at least a feature that apps need to implement.

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2025-04-23 16:03:20 +02:00
..
appinfo chore: Bump app versions and requirements 2025-01-23 08:56:06 +01:00
composer refactor: move version rollback hook to event 2025-02-25 14:03:21 +00:00
img chore: Make app icons consistent Material Symbols with same settings 2024-07-10 15:53:45 +02:00
l10n fix(l10n): Update translations from Transifex 2025-04-18 00:23:31 +00:00
lib fix(files_versions): create version if previous does not exist 2025-04-23 16:03:20 +02:00
src fix(files_versions): Rely on server mime fallback icons 2025-03-27 08:56:45 +01:00
tests fix(files_versions): Cache previews 2025-03-27 08:56:45 +01:00
.l10nignore chore: Add SPDX header 2024-06-02 20:00:00 +02:00
openapi.json feat(files_versions): Implement preview mime icon fallback 2025-03-27 08:56:45 +01:00
openapi.json.license chore: Add SPDX header 2024-06-02 20:00:00 +02:00