nextcloud/tests
Louis Chemineau 2e3cffa473 fix: Transfer ownership with S3 as primary
When using S3 as primary storage, transferring ownership with the `--move` option fail with the following error:

`SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '8-45b963397aa40d4a0063e0d85e4fe7a1' for key 'fs_storage_path_hash'`

The `--move` option moves the entire home folder from one account to another.
The error means that the move failed because the destination folder already exist in `oc_filecache`.

- With S3 as primary storage, folders only exists as entries in `oc_filecache`.
- With S3 as primary storage, `moveFromStorage(...)` only moves the cache entry, as nothing needs to be moved on disk. This cache move does not delete potentially pre-existing destination folder.
- With Local storage, `moveFromStorage(...)` calls `rename(...)` which delete pre-existing folder.

- `transfer(...)`: 687a4d9ac7/apps/files/lib/Service/OwnershipTransferService.php (L112)
- `oneTimeUserSetup(...)`: 687a4d9ac7/lib/private/Files/SetupManager.php (L261-L262)
- `mkdir(...)`: 687a4d9ac7/lib/private/Files/ObjectStore/ObjectStoreStorage.php (L91-L135)
- `moveFromStorage(...)`: 687a4d9ac7/lib/private/Files/ObjectStore/ObjectStoreStorage.php (L635-L636)

Delete pre-existing folder in `moveFromStorage(...)`

Signed-off-by: Louis Chemineau <louis@chmn.me>
2025-04-14 14:14:58 +00:00
..
apps Validate the info.xml against the appstore schema file 2018-02-16 10:23:51 +01:00
blueprints use blueprint from repo 2022-06-30 15:52:33 +02:00
Core fix(oauth2): retain support for legacy ownCloud clients 2025-04-02 10:28:21 +02:00
data fix(mime-types): adjust compiled mime types and sign 2025-03-13 21:30:14 +01:00
docker Use strict 2021-04-26 12:45:12 +02:00
lib fix: Transfer ownership with S3 as primary 2025-04-14 14:14:58 +00:00
objectstore
Test/Repair/Owncloud Adapt tests to config value typing 2023-04-05 17:42:14 +02:00
travis
apps.php fix: conflicts resolved in apps.php loadDirectory 2024-11-13 08:34:39 +05:30
bootstrap.php chore: Install phpunit via vendor bin 2023-10-02 11:33:14 +02:00
drone-run-integration-tests.sh Run integration tests on 3rdparty bump 2022-11-11 07:54:26 +01:00
drone-run-php-tests.sh fix: also run phpunit on apps/theming/css modified files 2023-07-12 09:25:39 +02:00
drone-wait-objectstore.sh Use minio for s3 tests 2021-07-01 08:22:24 +02:00
enable_all.php Add tests 2018-01-25 13:44:47 +01:00
karma.config.js test: fix CI when running Karma tests 2025-03-19 18:02:17 +01:00
karma.setup.js fix: update babel and fix karma 2025-03-06 16:32:44 +01:00
phpunit-autotest-external.xml
phpunit-autotest.xml Fix unit tests on PHP 8.3 2023-10-16 10:17:22 +02:00
preseed-config.php test: re-add object store primary storage phpunit tests 2024-10-09 14:50:02 +02:00
redis-cluster.config.php
redis.config.php chore(tests): Align oracle database tests with the other databases 2024-01-26 14:53:32 +01:00
startsessionlistener.php Format control structures, classes, methods and function 2020-04-10 14:19:56 +02:00