Commit Graph

588 Commits

Author SHA1 Message Date
invario 34e255d193 fix(files_trashbin): create folder if missing when expiring
Signed-off-by: invario <67800603+invario@users.noreply.github.com>
2026-06-22 21:33:24 +02:00
Côme Chilliet b37044d484 chore: Fix psalm issues following strong typing of IUser
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2026-06-11 09:45:32 +02:00
Côme Chilliet 9d7c277668 fix: Remove static vars in trashbin, versions and storages
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2026-06-02 09:46:16 +02:00
Côme Chilliet 1ab09ec753 chore: Apply new coding standard to all files
The diff can be checked using: git diff --ignore-all-space --ignore-blank-lines
To see only the changes not related to blank lines.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2026-06-01 13:46:39 +02:00
Ferdinand Thiessen d8e8703796 chore: add missing Override attribute to app code
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2026-04-28 21:29:28 +02:00
Robin Appelman 68448a4a42 feat: export getData for public FileInfo interface
Signed-off-by: Robin Appelman <robin@icewind.nl>
2026-04-24 14:39:51 +02:00
provokateurin 5d1e0a6e3a fix(Wrapper): Always use getWrapperStorage()
Signed-off-by: provokateurin <kate@provokateurin.de>
2026-04-14 16:08:37 +02:00
Robin Appelman 966db54089 chore: psalm fix
Signed-off-by: Robin Appelman <robin@icewind.nl>
2026-04-01 19:25:27 +02:00
Robin Appelman b76cdd09cc fix: catch all exceptions during trashbin cache move
Signed-off-by: Robin Appelman <robin@icewind.nl>
2026-04-01 19:24:26 +02:00
Robin Appelman 7eae0e5f8c chore: deduplicate trashbin row delete logic
Signed-off-by: Robin Appelman <robin@icewind.nl>
2026-04-01 18:09:29 +02:00
Hoang Pham b7150ad88c perf(trashbin): avoid full rescan for uncached moves
Signed-off-by: Hoang Pham <hoangmaths96@gmail.com>
2026-04-01 18:00:21 +02:00
Hoang Pham eedd8dce3c fix(trashbin): keep metadata consistent on move
Signed-off-by: Hoang Pham <hoangmaths96@gmail.com>
2026-04-01 18:00:21 +02:00
Hoang Pham ac9c17c7b8 fix: keep trashbin cache and db in sync
Signed-off-by: Hoang Pham <hoangmaths96@gmail.com>
2026-04-01 18:00:19 +02:00
Kate 0cf140e903 Merge pull request #58761 from nextcloud/feat/1700/limit-recent-files 2026-03-26 09:05:14 +01:00
Cristian Scheid 282e6b707a feat(file-info): encapsulate logic to get last activity in getLastActivity function
Signed-off-by: Cristian Scheid <cristianscheid@gmail.com>
2026-03-24 15:15:34 -03:00
Josh 8bd63c5fe2 chore(Trashbin): hello lint
Signed-off-by: Josh <josh.t.richards@gmail.com>
2026-03-21 11:50:28 -04:00
Josh e53c124ecc chore(trashbin): drop unused use statements from SyncLivePhotosListener
Signed-off-by: Josh <josh.t.richards@gmail.com>
2026-03-21 11:50:28 -04:00
Josh 5f658d9eae chore(Trashbin): add AbortedEventException use
Signed-off-by: Josh <josh.t.richards@gmail.com>
2026-03-21 11:50:28 -04:00
Josh bd0784e056 refactor(Trashbin): switch to AbortedEventException usage in restore
Signed-off-by: Josh <josh.t.richards@gmail.com>
2026-03-21 11:50:28 -04:00
Josh 23569000a8 chore(trashbin): switch SyncLivePhotosListener to AbortedEventException
Signed-off-by: Josh <josh.t.richards@gmail.com>
2026-03-21 11:50:28 -04:00
Josh 4b2a77b1ff chore(trashbin): refactor deprecated abortOperation to use AbortedEventException
Signed-off-by: Josh <josh.t.richards@gmail.com>
2026-03-21 11:50:28 -04:00
nextcloud-command 663018455e refactor: Apply rector changes
Signed-off-by: GitHub <noreply@github.com>
2026-03-01 14:43:11 +00:00
Carl Schwan f6c839d125 refactor(psalm): Modernize migration doc
And remove all the duplication in the subclasses

Signed-off-by: Carl Schwan <carlschwan@kde.org>
2026-02-12 11:25:55 +01:00
provokateurin f12cecb684 feat(rector): Enable SafeDeclareStrictTypesRector
Signed-off-by: provokateurin <kate@provokateurin.de>
2026-02-09 10:59:31 +01:00
Carl Schwan a8d69ffed1 refactor: Commands and background jobs for the trashbin
- Use modern node and SetupManager API
- Avoid passing the user by id and instead use IUser

Signed-off-by: Carl Schwan <carl.schwan@nextcloud.com>
Signed-off-by: Carl Schwan <carlschwan@kde.org>
2026-01-28 21:44:30 +01:00
Carl Schwan ae73f7aaf5 refactor(setup-manager): Use ISetupManager instead of SetupManager
Keep using the OC API in the mount manager and OC_Utils, but the rest is
now using the public API.

Signed-off-by: Carl Schwan <carlschwan@kde.org>
2026-01-27 15:19:19 +01:00
Josh 80caedb050 chore: php-cs fixup
Signed-off-by: Josh <josh.t.richards@gmail.com>
2025-12-27 00:30:19 -05:00
Josh 853db93601 chore: typo fixup
Signed-off-by: Josh <josh.t.richards@gmail.com>
2025-12-27 00:26:11 -05:00
Josh 355d6637ff refactor(trashbin): restyle DAV handlers, enhance internal docs, refactor for clarity & robustness
Signed-off-by: Josh <josh.t.richards@gmail.com>
2025-12-27 00:07:19 -05:00
Carl Schwan 2ae9626fec refactor(user_ldap): Port most of the remaining deprecated IConfig usage
Signed-off-by: Carl Schwan <carl.schwan@nextcloud.com>
2025-12-11 13:27:48 +01:00
Maxence Lange ea8b133910 fix(trashbin): deletedBy of a file from a federated folder
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>

d
2025-12-01 16:25:05 -01:00
Carl Schwan 4d47fdaa85 chore: Run rector with new rules for fetch
Signed-off-by: Carl Schwan <carl.schwan@nextcloud.com>
2025-11-18 17:45:57 +01:00
Thomas Citharel b44f35a42a refactor(trashbin): get expiration class directly from Server::get
instead of going through Application container

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2025-10-23 23:20:10 +02:00
Thomas Citharel 05d5fdb429 fix(trashbin): include $availableSpace = 0 in checks when we need to delete expired files
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2025-10-23 23:20:10 +02:00
Thomas Citharel 29d72bfb32 revert(trashbin): 195d347 due to misunderstanding
See https://github.com/nextcloud/documentation/pull/13017#issuecomment-3425782690

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2025-10-23 23:20:10 +02:00
Thomas Citharel cea23fb53d refactor(trashbin): make the ExpireTrash background job use the Trashbin::expire static method
Instead of handling everything itself, and so that the available space is considered in deleting
trashed files even if not expired yet.

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2025-10-14 11:07:25 +02:00
Thomas Citharel 195d347240 fix(trashbin): make sure the trashed files are deleted if we don't have any available space left
Logic taken from the files_versions expiration. It seems the second
argument from the isExpired method wasn't even used anywhere.

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2025-10-14 10:58:30 +02:00
provokateurin 8d8f94b8ce fix(files): Always return a valid mimetype
Signed-off-by: provokateurin <kate@provokateurin.de>
2025-10-06 09:06:17 +02:00
Kate 81d0c73700 Merge pull request #55360 from nextcloud/refactor/rector 2025-09-28 12:28:46 +02:00
Ferdinand Thiessen 660f3f6fd1 refactor: use logical && || instead of weak and or operators
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2025-09-27 23:02:18 +02:00
provokateurin 6a12fbc4f3 refactor: Run rector
Signed-off-by: provokateurin <kate@provokateurin.de>
2025-09-27 18:52:58 +02:00
Marcel Müller 58440bfc67 fix: Stop infinite loop in ExpireTrash
Signed-off-by: Marcel Müller <marcel-mueller@gmx.de>
2025-09-24 21:41:10 +02:00
Joas Schilling cb67bcecf0 fix(trashbin): Translate Nextcloud exception to Sabre exception
Signed-off-by: Joas Schilling <coding@schilljs.com>
2025-09-19 11:47:40 +02:00
Kate c0dc179c8e Merge pull request #54950 from nextcloud/fix/files_trashbin/size-propagation 2025-09-09 15:36:32 +02:00
provokateurin b36af651fd fix(files_trashbin): Fix size propagation when moving file to trash
Signed-off-by: provokateurin <kate@provokateurin.de>
2025-09-09 13:39:08 +02:00
Louis Chemineau 9b5d11845a feat(files_trashbin): Refactor expire background job to support parallel run
- Follow-up of #51600

The original PR introduced the possibility to continue an `ExpireTrash` job by saving the offset. This was to prevent having to start over the whole user list when the job crashed or was killed.

But on big instances, one process is not enough to go through all the users in a timely manner. Supporting parallel run allows covering more ground faster.

This PR introduced this possibility. We are now storing the offset right away to allow another parallel job to pick up the task at that point. We are arbitrarily cutting the user list in chunk of 10 to not drastically overflow the 30 minutes time limit.

Signed-off-by: Louis Chemineau <louis@chmn.me>
2025-09-08 12:33:25 +02:00
Côme Chilliet 5c9c2fe5e2 fix(trashbin): Fix errors in the log on MOVE operations
dirname will return '.' for files at the root, which will cause an
 Exception that gets logged.
Instead use \Sabre\Uri\split like other sabre plugins, to get an empty
 string for root directory.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2025-08-25 16:36:55 +02:00
Robin Appelman f3850b141a fix: fix trashbin restore events
Signed-off-by: Robin Appelman <robin@icewind.nl>
2025-08-19 20:46:56 +02:00
Ferdinand Thiessen 6b0bce8a2d fix(files_trashbin): has-preview must return true or false
Currently it returned the boolean value, but PHP will turn it into an
integer...

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2025-08-07 01:23:10 +02:00
Kent Delante 1ccf491a9e fix(files_trashbin): Expire trashbin items when space is needed
Signed-off-by: Kent Delante <kent.delante@proton.me>
2025-07-05 14:12:30 +08:00