90948[TASK] Improve ResourceStorage->getUniqueName() to reduce collisions
Commit message
Review
-
Code review CR +2 Done
- Stefan Bürk +2
- Markus Klein +1
- Christian Kuhn +1
-
Verified V +2 Done
- Stefan Bürk +2
- Christian Kuhn +1
- core-ci +1 CI
Issues 1
Files 1
Review log 1518
-
Alexander Schnitzler uploaded patch set 1 10/07/25, 15:20
-
core-ci voted on patch set 1 V +1 10/07/25, 15:28 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/86169
-
Alexander Schnitzler uploaded patch set 2
V +110/07/25, 15:45 -
Alexander Schnitzler wrote 10/07/25, 15:46
Topic set to FAL -
core-ci voted on patch set 2 V +1 10/07/25, 15:52 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/86171
-
Alexander Schnitzler marked it ready for review 10/07/25, 15:52
-
Alexander Schnitzler uploaded patch set 3
V +110/07/25, 16:00 -
core-ci voted on patch set 3 V +1 10/07/25, 16:07 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/86172
-
Garvin Hicking commented on patch set 3 10/07/25, 16:45
ResourceStorage.php:2577I wonder if instead using this "again! again! again!" logic that possible wrecks your file I/O lookups in case of remote file systems, why not cut this short and use an easy hashing algo after like the third try or so, and append that? Two tries may be for a "sensible" counter might be acceptable before a long filename kicks in? -
Alexander Schnitzler commented on patch set 3 10/07/25, 17:38
ResourceStorage.php:2577ReplyI wonder if you intentionally commented at this place. This fallback method is actually less I/O heavy than the 99 checks for file names _01-_99. Hitting a used file name here more than once is close to impossible. So, yes, we could cut this part short and just try 3 times but the tries are actually just an exit strategy for this loop in case weird things on the driver are happening. Any real world scenario will have a unique file name at the first or second try. I am happy to discuss the earlier approach though. To me, appending 01-99 doesn't bring any benefit at all. Maybe someone has some insights here. If it were up to me, I would skip that part and use slightly longer random string. Starting with 8 characters, it's completely unlikely to hit a used file name. With 10 even more. We could also leverage Random:generateRandomHexString for that btw but I kept this patch conservative to be able to backport if this can be considered a bugfix. -
Garvin Hicking commented on patch set 3 10/07/25, 18:06
ResourceStorage.php:2577ReplyI meant the general approach. Each time I stumbled across it I wondered if we should keep it. Personally I'd embrace the chance to add a "slightly longer random string", yes. I'm sorry that came across offending your patch, that was not my intention. Happy for other feedbsck/input. Mine is definitely not blocking. -
Alexander Schnitzler commented on patch set 3 10/07/25, 19:57
ResourceStorage.php:2577ReplyDon’t worry. Nothing’s offensive here. Just wanted to make sure I understand your comment better. -
Christian Kuhn voted on patch set 3 CR +1 V +1 10/08/25, 22:56
-
Markus Klein commented on patch set 3 10/09/25, 05:54
why not v13 as well? -
Alexander Schnitzler commented on patch set 3 10/09/25, 06:16
Reply
I learnt that patches that are too specific are often argued about unnecessarily and it's better to have a more open first approach to let the patch develop in one way or the other. One undiscussed proposal is to remove the 01-09 suffix altogether and I want to leave the argument, whether that's breaking, to others. The patch, as is, can be ported to 13 IMHO. -
Markus Klein commented on patch set 3 CR +1 10/09/25, 12:39
Reply
Thanks, for the info. I was more curious if something speaks against having this in the stable version too. -
Stefan Bürk voted on patch set 3 CR +2 V +2 10/10/25, 20:37
-
Stefan Bürk merged patch set 4 10/10/25, 20:37