Commit graph

450 commits

Author SHA1 Message Date
Ferdinand Thiessen
832f79ac93
chore: apply code style
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2025-04-30 19:04:59 +02:00
Ferdinand Thiessen
378eb64d8e 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-24 11:31:13 +00:00
provokateurin
4e7fc5bfbf
feat(files_versions): Implement preview mime icon fallback
Signed-off-by: provokateurin <kate@provokateurin.de>
2025-03-28 12:01:58 +01:00
provokateurin
2f73d92602
fix(files_versions): Cache previews
Signed-off-by: provokateurin <kate@provokateurin.de>
2025-03-28 11:58:42 +01:00
Louis
acf19f7880
Revert "Revert "[stable30] fix: Handle copy of folders containing live photos""
Signed-off-by: Louis Chemineau <louis@chmn.me>
2025-03-05 13:45:23 +01:00
Louis Chemineau
28959970dc fix(files_versions): Do not expire versions newer than min age
The auto expire logic does not take into account the min retention age set by the admin. So versions were eagerly deleted.

Fix https://github.com/nextcloud/server/issues/19791

Signed-off-by: Louis Chemineau <louis@chmn.me>
2025-02-25 15:03:13 +00:00
Kostiantyn Miakshyn
3012a87bac Fix: NotFoundException for anonymous users
Signed-off-by: Kostiantyn Miakshyn <molodchick@gmail.com>
2025-02-24 15:13:48 +00:00
Louis Chemineau
c5be24db97 fix(files_versions): Update unencrypted_size during rollback
This prevent restored version of encrypted files from having a wrong reported size. This was blocking download.

Signed-off-by: Louis Chemineau <louis@chmn.me>
2025-01-29 09:40:56 +00:00
Louis Chemineau
b8c7533360 chore(files_versions): Remove unused $node variable
Signed-off-by: Louis Chemineau <louis@chmn.me>
2025-01-29 09:40:56 +00:00
Louis
cabedbf9c3
Revert "[stable30] fix: Handle copy of folders containing live photos" 2024-12-12 14:28:09 +01:00
Louis Chemineau
9ff3ba7ce0
fix: Correctly create NonExistingFolder during copy
Signed-off-by: Louis Chemineau <louis@chmn.me>
2024-12-05 10:35:42 +01:00
John Molakvoæ
1fa9d3987b
Merge pull request #46887 from nextcloud/fix/versions-catch-insertion-error 2024-08-14 10:32:45 +02:00
Kate
1044b7f0b9
Merge pull request #46813 from nextcloud/refactor/files_versions/security-attributes 2024-08-14 09:46:46 +02:00
Ferdinand Thiessen
4bbcbc5206
feat: Make ISharedStorage public API and reuse where possible
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2024-08-12 11:42:10 +02:00
Stephan Orbaugh
199ee80795
Merge pull request #46710 from nextcloud/artonge/fix/use_timestamp_instead_of_revision
fix: Use timestamp instead of revision id in files_versions metadata API
2024-08-06 15:00:41 +02:00
Côme Chilliet
30a2e8f9b8
fix(files_versions): Catch constraint error on version insertion
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2024-07-30 17:09:10 +02:00
provokateurin
2c8f6a009a
refactor(files_versions): Replace security annotations with respective attributes
Signed-off-by: provokateurin <kate@provokateurin.de>
2024-07-27 21:34:00 +02:00
greta
26d22881e5 fix: add a try and catch for delete versioning
Signed-off-by: greta <gretadoci@gmail.com>
2024-07-25 14:46:06 +02:00
carhe
7eac3fe7da fix(files_versions): avoid unintentional skipping of expiration
Signed-off-by: carhe <carstenherrmann@web.de>
2024-07-25 12:29:04 +02:00
Louis Chemineau
6e76aed867
fix: Use timestamp instead of revision id in files_versions metadata API
Signed-off-by: Louis Chemineau <louis@chmn.me>
2024-07-24 09:34:13 +02:00
Andy Scherzinger
afa48a4e0e
chore: Add SPDX header
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
2024-06-02 20:00:00 +02:00
Louis Chemineau
369274c9ee
feat(files_versions): Add listener and interfaces to allow versions migration across storages
Signed-off-by: Louis Chemineau <louis@chmn.me>
2024-03-26 17:40:31 +01:00
Louis
ddb84f9738
Merge pull request #44362 from nextcloud/artonge/feat/check_permissions_of_all_nodes_for_versions
Check permissions of all accessible file for versions
2024-03-22 20:35:11 +01:00
Louis Chemineau
a15c0d6515
Merge pull request #44297 from nextcloud/fix/forbid-tagging-readonly-files
Forbid tagging readonly files

Signed-off-by: Louis Chemineau <louis@chmn.me>
2024-03-21 15:10:30 +01:00
Louis Chemineau
673a851848 refactor(files_versions): Rename MetadataFileEvents to VersionAuthorListener
Signed-off-by: Louis Chemineau <louis@chmn.me>
2024-03-21 12:30:01 +01:00
John Molakvoæ
2ff172004a
Merge pull request #43613 from nextcloud/version-owner-fallback 2024-03-16 13:23:06 +01:00
Louis Chemineau
9361a305ba
chore(files_versions): Use new metadata API for versions
Signed-off-by: Louis Chemineau <louis@chmn.me>
2024-03-13 15:27:06 +01:00
Eduardo Morales
c5d1fda4ab fix: fixed stylistic errors
Signed-off-by: Eduardo Morales <emoral435@gmail.com>
2024-03-11 15:57:12 -05:00
Eduardo Morales
a8844d408b fix(files_version): deprecated INameableVersion
Signed-off-by: Eduardo Morales <emoral435@gmail.com>
2024-03-11 15:57:12 -05:00
Eduardo Morales
4cf4fdc278 feat: exposed metadata column to frontend
Signed-off-by: Eduardo Morales <emoral435@gmail.com>
2024-03-11 15:57:12 -05:00
Eduardo Morales
b2c855451c feat: added backend metadata interface, allows JSON storage
Signed-off-by: Eduardo Morales <emoral435@gmail.com>
2024-03-11 15:57:12 -05:00
Eduardo Morales
88b40bb392 feat: added metadata event listener
Signed-off-by: Eduardo Morales <emoral435@gmail.com>
2024-03-11 15:57:12 -05:00
Louis
310c8be748
Revert "files_versions: add missing null check" 2024-03-08 10:33:30 +00:00
Robin Appelman
1125cf7afc
fix: fallback from guessing the owner from path in versioning
Signed-off-by: Robin Appelman <robin@icewind.nl>
2024-03-07 23:15:09 +01:00
Varun Patil
d49787d004 fix(files_versions): Add missing null check
Signed-off-by: Varun Patil <varunpatil@ucla.edu>
2024-03-07 11:21:57 -08:00
Louis Chemineau
fcdc8b47f2 fix(files_versions): Improve files version listing
Signed-off-by: Louis Chemineau <louis@chmn.me>
2024-03-06 10:15:31 +01:00
Robin Appelman
fd4ca13867
Merge pull request #43471 from nextcloud/cache-path-by-id
Cache path by id
2024-03-05 17:26:25 +01:00
John Molakvoæ
a58ed05f1d
Merge pull request #43898 from nextcloud/artonge/fix/improve_files_versions_listing
Improve files version listing
2024-03-04 17:23:18 +01:00
Robin Appelman
e7a7b4a401 perf: switch places that always use the first getById result to getFirstNodeById
Signed-off-by: Robin Appelman <robin@icewind.nl>
2024-03-04 13:57:31 +01:00
Louis Chemineau
66fbb7be76 fix(files_versions): Do not create a new version for empty files
Signed-off-by: Louis Chemineau <louis@chmn.me>
2024-02-29 21:32:28 +01:00
Louis Chemineau
870572783a fix(files_versions): Improve files version listing
Signed-off-by: Louis Chemineau <louis@chmn.me>
2024-02-29 21:32:20 +01:00
Louis Chemineau
046b8f320f
Check permissions when labeling a version
Signed-off-by: Louis Chemineau <louis@chmn.me>
2024-02-21 15:09:33 +01:00
Louis Chemineau
37d0fd109a
Check node permissions when restoring a version
Signed-off-by: Louis Chemineau <louis@chmn.me>
2024-02-21 15:06:01 +01:00
Louis Chemineau
741dec283f
Check node permissions when deleting a version
Signed-off-by: Louis Chemineau <louis@chmn.me>
2024-02-21 15:06:01 +01:00
Vincent Petry
839ddaa354
feat: rename users to account or person
Replace translated text in most locations

Signed-off-by: Vincent Petry <vincent@nextcloud.com>
2024-02-13 21:06:30 +01:00
Louis Chemineau
5ae0f5b32f
Revert "Reapply "Cleanup versions entity in during versions:clean command""
This reverts commit ba3fdb0cdc.
2024-02-08 18:47:07 +01:00
Louis Chemineau
ba3fdb0cdc
Reapply "Cleanup versions entity in during versions:clean command"
This reverts commit 17ee596826.
2024-02-07 16:11:33 +01:00
Louis Chemineau
17ee596826
Revert "Cleanup versions entity in during versions:clean command"
This reverts commit 1ec9f3e5f9.
2024-02-01 23:37:26 +01:00
Louis Chemineau
1ec9f3e5f9
Cleanup versions entity in during versions:clean command
Signed-off-by: Louis Chemineau <louis@chmn.me>
2024-02-01 16:44:57 +01:00
Côme Chilliet
8bcc2d352e chore: Fix missing template parameter for IEventListener
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2024-01-30 10:57:15 +01:00