Review 12.4 Merged

82018[BUGFIX] Fix value-picker initialization race condition

Oli Bartsch CR +2 V +2 Normal +45 −20 updated 12/01/23, 07:33

Commit message

(Custom) element children 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. That means we can not assume that value-picker
<select> children will always be available.

Note that it worked most of the times, because JavaScript modules are
loaded asynchronously, and thus "most of the times" execute later after
the DOM is rendered, but when the server is really busy, the HTML output
can be rendered very late, so that a connectedCallback is triggered
immediately when an opening tag is written to the DOM — even before the
childrens are attached. (Otherwise the browsers would have to delay the
connectedCallback's until the closing tag is rendered, but that's not
the case — at least not in google chrome.)

To circumvent this we use a slotchange listener (which is basically a
mutation observer) to assure we are notified about async child updates.

Review

  • Code review CR +2 Done
    • Oli Bartsch +2
  • Verified V +2 Done
    • Oli Bartsch +2
    • core-ci +1 CI

Issues 2

Files 2

Review log 34

  1. Oli Bartsch commented on patch set 1 12/01/23, 07:17

    Cherry Picked from branch main.
  2. core-ci voted on patch set 1 V +1 12/01/23, 07:24 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/50193

  3. Oli Bartsch voted on patch set 1 CR +2 V +2 12/01/23, 07:33

  4. Oli Bartsch merged patch set 2 12/01/23, 07:33