nextcloud-server/tests
Louis Chemineau 9bed21a8d7 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 16:18:42 +07:00
..
Core fix(oauth2): retain support for legacy ownCloud clients 2025-04-02 12:23:45 +07:00
Test/Repair/Owncloud chore: Add SPDX header 2024-05-13 17:41:36 +07:00
apps chore: Add SPDX header 2024-05-13 17:41:36 +07:00
blueprints chore: Add SPDX header 2024-05-13 17:41:36 +07:00
data fix(mime-types): adjust compiled mime types and sign 2025-03-12 15:29:25 +07:00
docker chore: Add SPDX header 2024-05-13 17:41:36 +07:00
lib fix: Transfer ownership with S3 as primary 2025-04-16 16:18:42 +07:00
objectstore chore: Add SPDX header 2024-05-22 19:58:12 +07:00
travis chore: Add SPDX header 2024-05-22 19:58:12 +07:00
apps.php fix: conflicts resolved in apps.php loadDirectory 2024-11-13 09:11:43 +07:00
bootstrap.php chore: Add SPDX header 2024-05-13 17:41:36 +07:00
drone-run-integration-tests.sh chore: Add SPDX header 2024-05-13 17:41:36 +07:00
drone-run-php-tests.sh chore: Add SPDX header 2024-05-13 17:41:36 +07:00
drone-wait-objectstore.sh chore: Add SPDX header 2024-05-13 17:41:36 +07:00
enable_all.php chore(webhooks): Rename webhooks application to webhook_listeners 2024-06-11 14:10:29 +07:00
karma.config.js test: fix CI when running Karma tests 2025-03-17 20:33:46 +07:00
phpunit-autotest-external.xml chore: Add SPDX header 2024-05-13 17:41:36 +07:00
phpunit-autotest.xml chore: Add SPDX header 2024-05-13 17:41:36 +07:00
preseed-config.php test: re-add object store primary storage phpunit tests 2025-02-13 17:31:51 +07:00
redis-cluster.config.php chore: Add SPDX header 2024-05-13 17:41:36 +07:00
redis.config.php chore: Add SPDX header 2024-05-13 17:41:36 +07:00
startsessionlistener.php chore: Add SPDX header 2024-05-13 17:41:36 +07:00