#106371Problem with CustomElements in the Backend on really slow connections
Description
in cms-backend the CustomElements (like typo3-formengine-container-files ) might be registered and initialized before the actual markup is loaded, leading to unresponsive interface elements or events/actions not happening.
I was able to reproduce the problem on my Mac by installing the “Network Link Conditioner” preference pane from the XCode Additional Developer tools, and setting my connection to ‘Very bad network’
The effect of the problem manifested for me when in cms-backend/Resources/Public/JavaScript/form-engine/container/files-control-container.js the following line is called:
window.customElements.define("typo3-formengine-container-files",FilesControlContainer)
while the concrete form is still loading and the
<typo3-formengine-container-files></typo3-formengine-container-files>
is not in the dom yet. This means this line is called while document.readyState is still loading or the DomReady event is not yet called.
A window.setTimeout mitigated the problem for me for now, but this should rather be part of the initialzation which happens in the DocumentService.ready() promise. Maybe some kind of initialization queue for these kind of CustomElements?
This is not an academic problem, this is a real world problem brought to me by editors which happen to have complicated setups or ancient connections…
The effect on typo3-formengine-container-files is – when it is initialized too early – that you can not open the files, not deleted or hide them. Additionally the insert event is not registered, which means you can open the picker, choose a file, and nothing happens, not even an error..
I had as well reports for this happening to the Datepicker as well, which I guess is registered in a similar way.
This is valid for TYPO3 12 and 13.
Reviews 5
- 13.4 89275[BUGFIX] Fix race conditions in color-picker
- main 89257[BUGFIX] Fix race conditions in color-picker
- 12.4 88638[BUGFIX] Fix race conditions in childnode querying custom elements
- 13.4 88637[BUGFIX] Fix race conditions in childnode querying custom elements
- main 88589[BUGFIX] Fix race conditions in childnode querying custom elements
Related issues 3
History 712
-
Benjamin Franzke changed status
NewAccepted <span data-processor="relativetime" data-value="2025-03-14T07:05:54+00:00" > 03/14/25, 07:05 </span> -
Benjamin Franzke changed Related to #102550 <span data-processor="relativetime" data-value="2025-03-14T07:13:24+00:00" > 03/14/25, 07:13 </span>
-
Benjamin Franzke changed Related to #102603 <span data-processor="relativetime" data-value="2025-03-14T07:13:36+00:00" > 03/14/25, 07:13 </span>
-
Benjamin Franzke changed priority
Should haveMust have <span data-processor="relativetime" data-value="2025-03-14T07:13:50+00:00" > 03/14/25, 07:13 </span> -
Gerrit Code Review pushed patch set 1 for main to change 88589 status
AcceptedUnder Review <span data-processor="relativetime" data-value="2025-03-14T08:20:46+00:00" > 03/14/25, 08:20 </span> -
Gerrit Code Review pushed patch set 2 for main to change 88589 <span data-processor="relativetime" data-value="2025-03-14T09:11:42+00:00" > 03/14/25, 09:11 </span>
-
Gerrit Code Review pushed patch set 3 for main to change 88589 <span data-processor="relativetime" data-value="2025-03-14T15:13:57+00:00" > 03/14/25, 15:13 </span>
-
Gerrit Code Review pushed patch set 1 for 13.4 to change 88637 <span data-processor="relativetime" data-value="2025-03-18T08:18:28+00:00" > 03/18/25, 08:18 </span>
-
Gerrit Code Review pushed patch set 1 for 12.4 to change 88638 <span data-processor="relativetime" data-value="2025-03-18T08:23:55+00:00" > 03/18/25, 08:23 </span>
-
Benjamin Franzke commented and changed status
Under ReviewResolved done0 %100 % <span data-processor="relativetime" data-value="2025-03-18T08:45:08+00:00" > 03/18/25, 08:45 </span> -
Andreas Kienast changed Related to #106630 <span data-processor="relativetime" data-value="2025-04-28T10:03:57+00:00" > 04/28/25, 10:03 </span>
-
Benni Mack changed status
ResolvedClosed <span data-processor="relativetime" data-value="2025-12-02T14:22:35+00:00" > 12/02/25, 14:22 </span>
Applied in changeset commit:38e558813acd762aaf4bf718f271157143c10089.