nextcloud/tests
Louis Chemineau 27ed921ad5 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-16 10:19:17 +02:00
..
apps chore: Add SPDX header 2024-05-13 17:41:36 +02:00
blueprints chore: Add SPDX header 2024-05-13 17:41:36 +02:00
Core fix(oauth2): retain support for legacy ownCloud clients 2025-04-02 12:05:18 +02:00
data fix: add event status and participant status 2025-03-28 04:34:44 -04:00
docker chore: Add SPDX header 2024-05-13 17:41:36 +02:00
lib fix: Transfer ownership with S3 as primary 2025-04-16 10:19:17 +02:00
objectstore chore: Add SPDX header 2024-05-22 19:58:12 +02:00
apps.php fix(tests): Fix test selection and run unit tests of DAV and user_status 2024-09-19 17:44:45 +02:00
bootstrap.php chore: Add SPDX header 2024-05-13 17:41:36 +02:00
drone-run-integration-tests.sh chore: Add SPDX header 2024-05-13 17:41:36 +02:00
drone-run-php-tests.sh chore: Add SPDX header 2024-05-13 17:41:36 +02:00
drone-wait-objectstore.sh chore: Add SPDX header 2024-05-13 17:41:36 +02:00
enable_all.php chore(deps): Update nextcloud/coding-standard to v1.3.1 2024-09-19 14:21:20 +02:00
karma.config.js test: fix CI when running Karma tests 2025-03-20 15:41:58 +01:00
phpunit-autotest-external.xml chore: Add SPDX header 2024-05-13 17:41:36 +02:00
phpunit-autotest.xml chore: ignore vendor-bin for coverage 2024-12-16 15:47:17 +01:00
preseed-config.php test: re-add object store primary storage phpunit tests 2024-09-27 14:45:39 +02:00
redis-cluster.config.php chore: Add SPDX header 2024-05-13 17:41:36 +02:00
redis.config.php chore: Add SPDX header 2024-05-13 17:41:36 +02:00
startsessionlistener.php style: update codestyle for coding-standard 1.2.3 2024-08-25 19:34:58 +02:00