nextcloud-server/tests/lib
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
..
Accounts fix(AccountManager): Sanitize social media handles 2025-02-07 12:41:49 +07:00
Activity
App fix(TemplateLayout): `core` is not an app but the server itself 2025-01-29 08:37:33 +07:00
AppFramework fix: Change UserAgent to *cloud 2025-02-21 09:29:26 +07:00
Archive
Authentication fix: Do not build encrypted password if there is none 2025-03-28 15:18:03 +07:00
Avatar
BackgroundJob
Cache
Calendar
Collaboration test: Adapt tests to properly use valid email addresses 2025-03-30 01:35:25 +07:00
Command refactor: simplify background commands 2024-07-01 12:52:06 +07:00
Comments fix(comments): Add test for email mention 2024-10-18 06:21:01 +07:00
Contacts/ContactsMenu
DB fix: misc code fixes around db sharding 2024-09-16 12:19:20 +07:00
Diagnostics
DirectEditing
Encryption
Federation fix(federation): Fix returning "no display name" after cache result 2025-04-10 12:37:59 +07:00
Files fix: Transfer ownership with S3 as primary 2025-04-16 16:18:42 +07:00
FilesMetadata test: add some minimal testing for metadata storage 2024-12-05 10:35:24 +07:00
GlobalScale
Group test: fix periodic `Test\Group\DatabaseTest::testSearchGroups` failure 2025-01-22 17:46:56 +07:00
Hooks
Http fix: do not query CNAME if A succeeded already 2024-11-14 10:45:23 +07:00
IntegrityCheck
L10N feat: reduce available languages per config value "reduce_to_languages" 2024-07-01 09:34:11 +07:00
Lock
Lockdown refactor(Token): introduce scope constants 2024-06-05 19:01:14 +07:00
Log
Mail fix(Mailer): Fix sendmail binary fallback 2025-02-12 13:23:11 +07:00
Memcache fix: delay calculating global cache prefix untill a cache is created 2024-08-28 14:54:14 +07:00
Migration
Net fix(tests): Add IpAddressClassifier v6 zone ID test 2024-11-07 09:30:06 +07:00
Notification
OCS
Preview fix(preview): Filter for folders in cleanup old preview job 2025-01-27 15:09:36 +07:00
Profile/Actions fix(FediverseAction): Ensure valid fediverse links are generated 2025-02-07 12:41:49 +07:00
PublicNamespace
Remote
Repair refactor: convert sanitize account properties repair step to background job 2025-02-24 16:44:49 +07:00
RichObjectStrings
Route Merge pull request #45228 from smokris/heartbeat-route 2024-06-18 17:29:30 +07:00
Security feat(ip): use larger IPv6 range by default 2025-04-08 11:30:15 +07:00
Session fix(session): Log when session_* calls are slow 2024-08-07 09:02:10 +07:00
Settings
Share
Share20 fix(files_sharing): fix share creation error handling 2025-04-09 15:22:18 +07:00
Support
SystemTag fix(test): Make the test less flaky 2024-07-19 11:21:16 +07:00
Talk
TaskProcessing fix(taskprocessing): Fix tests 2025-01-27 21:13:16 +07:00
Template
TextProcessing fix(taskprocessing): fix tests 2024-08-30 14:06:15 +07:00
Traits fix(UserTrait): Fix backend initialization 2024-10-08 21:02:30 +07:00
Updater feat(migration-attributes): tests 2024-07-29 12:44:52 +07:00
User fix(session): Only mark sessions of permanent tokens as app passwords 2025-04-03 10:15:11 +07:00
Util
APITest.php
AllConfigTest.php fix(config): Throw PreconditionException always when it didn't match 2024-09-13 11:40:13 +07:00
AppConfigTest.php
AppScriptSortTest.php
AppTest.php fix(TemplateLayout): `core` is not an app but the server itself 2025-01-29 08:37:33 +07:00
AutoLoaderTest.php
CapabilitiesManagerTest.php
ConfigTest.php fix(config): add envCache tests for getKeys() 2024-09-16 15:06:03 +07:00
ContactsManagerTest.php fix(cardav): only show useres from enabled addressBooks in contacts menu 2025-03-21 15:14:46 +07:00
DateTimeFormatterTest.php
EmojiHelperTest.php
ErrorHandlerTest.php
EventSourceFactoryTest.php
HelperStorageTest.php
HookHelper.php
ImageTest.php
InfoXmlTest.php
InitialStateServiceTest.php
InstallerTest.php
LargeFileHelperGetFileSizeTest.php
LargeFileHelperTest.php
LegacyHelperTest.php
LoggerTest.php feat(log): Allow to combine log.conditions to only log (app&user) 2024-07-30 13:18:09 +07:00
MemoryInfoTest.php
NaturalSortTest.php
NavigationManagerTest.php
RepairTest.php
ServerTest.php fix(tests): Remove deprecated tests for ServerTest 2024-09-19 14:24:22 +07:00
SetupTest.php
SubAdminTest.php
TagsTest.php
TempManagerTest.php refactor(TempManager): Simplify and unify implementations and remove legacy behavior 2025-03-04 07:49:20 +07:00
TemplateFunctionsTest.php
TestCase.php feat: implement distributing partitioned queries over multiple shards 2024-08-28 14:54:14 +07:00
TestMoveableMountPoint.php
UpdaterTest.php
UrlGeneratorTest.php
UtilCheckServerTest.php fix(SetupCheck): Properly check public access to data directory 2024-08-08 22:08:42 +07:00
UtilTest.php fix(SetupCheck): Properly check public access to data directory 2024-08-08 22:08:42 +07:00