Review main Merged

88589[BUGFIX] Fix race conditions in childnode querying custom elements

Benjamin Franzke CR +2 V +2 Normal +55 −28 updated 03/18/25, 08:42

Commit message

Children (or even succeeding siblings) of custom elements are not
guaranteed to be available by the time the element is added to the
DOM — i.e. when the connectedCallback() is triggered by the
browser, even when the components and their children are server
rendered, slow connections and streaming can cause initialization
race conditions. That means we must never assume that DOM
is fully loaded in connectedCallback. See #102550 for details.

In previous attempts (#102550, #102603) we made use of
HTML event bubbling and slotchange events to detect children, but these
solutions are profound and in parts fragile to master.
Therefore we use the DocumentService sledgehammer to make sure
we do not race during element initialization.

Review

  • Code review CR +2 Done
    • Benjamin Franzke +2
    • Andreas Kienast +1
    • Benjamin Kott +1
  • Verified V +2 Done
    • Benjamin Franzke +2
    • Andreas Kienast +1
    • Benjamin Kott +1
    • core-ci +1 CI

Issues 3

Files 27

Show 7 more files

Review log 710

  1. Benjamin Franzke uploaded patch set 1 03/14/25, 08:20

  2. core-ci voted on patch set 1 V -1 03/14/25, 08:33 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/75579

  3. Benjamin Franzke uploaded patch set 2 V -1 03/14/25, 09:11

  4. core-ci voted on patch set 2 V +1 03/14/25, 09:20 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/75584

  5. Benjamin Franzke uploaded patch set 3 V +1 03/14/25, 15:13

  6. core-ci voted on patch set 3 V +1 03/14/25, 15:22 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/75602

  7. Benjamin Kott voted on patch set 3 CR +1 V +1 03/18/25, 08:15

  8. Andreas Kienast voted on patch set 3 CR +1 V +1 03/18/25, 08:16

  9. Benjamin Franzke voted on patch set 3 CR +2 V +2 03/18/25, 08:24

  10. Benjamin Franzke merged patch set 4 03/18/25, 08:42