0
0
Fork 0
mirror of https://github.com/nextcloud/server.git synced 2025-05-03 13:30:32 +00:00
nextcloud_server/tests/lib/Files
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 +02:00
..
AppData chore: Add SPDX header 2024-05-13 17:41:36 +02:00
Cache fix: Metadata field search 2025-01-27 18:57:00 +01:00
Config fix(users): Don't crash if disabled user is missing in the database 2024-09-23 18:06:38 +02:00
Mount chore: Add SPDX header 2024-05-13 17:41:36 +02:00
Node fix(tests): Fix Folder tests 2024-09-19 14:24:22 +02:00
ObjectStore Merge pull request #48221 from nextcloud/backport/30/fix_move_on_same_bucket 2024-09-20 10:06:14 +02:00
Search chore: Add SPDX header 2024-05-13 17:41:36 +02:00
SimpleFS chore: Add SPDX header 2024-05-13 17:41:36 +02:00
Storage fix: Transfer ownership with S3 as primary 2025-04-16 16:18:42 +02:00
Stream fix(users): Don't crash if disabled user is missing in the database 2024-09-23 18:06:38 +02:00
Type fix: make sure we process mime extensions as string 2025-02-06 15:15:41 +00:00
Utils chore: Add SPDX header 2024-05-13 17:41:36 +02:00
EtagTest.php chore: Add SPDX header 2024-05-13 17:41:36 +02:00
FileInfoTest.php chore: Add SPDX header 2024-05-13 17:41:36 +02:00
FilenameValidatorTest.php fix(IFilenameValidator): correctly handle case insensitivity 2025-03-24 11:46:43 +00:00
FilesystemTest.php chore: Add SPDX header 2024-05-13 17:41:36 +02:00
PathVerificationTest.php fix: Adjust filename validation messages 2024-08-30 14:48:23 +02:00
ViewTest.php test(View): Copy preserves content 2025-02-13 23:35:59 +00:00