Review main Merged

83126[BUGFIX] Do not race tree node loading

Andreas Kienast CR +2 V +2 Easy +6 −10 updated 03/04/24, 07:54

Commit message

When (de-)mounting pages in the page tree, always two requests are sent
to the server that fetch the tree data:

* when the `mountPointPath` path property is changed as it's a state
  property
* explicitly after changing said property

Especially when de-mounting a page, this tends to race conditions, as
the mount state is additionally stored in the backend user's UC that
needs to get unset as well.

This bugfix now changes the handling when the state property, that
triggers a re-rendering of the tree component, is updated. The
de-mounting process now unsets the backend user's UC first and then
changes the property to make sure that

1. the state is updated once the configuration is flushed
2. the tree nodes are fetched only once

In the mounting process, the UC is correctly updated first. However, the
state was updated and then the nodes were reloaded explicitly. The
latter is not required at all.

Review

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

Issues 1

Files 4

Review log 1316

  1. Andreas Kienast uploaded patch set 1 02/26/24, 07:24

  2. core-ci voted on patch set 1 V +1 02/26/24, 07:30 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/53565

  3. Andreas Kienast updated the commit message in patch set 2 V +1 02/29/24, 08:49

  4. core-ci voted on patch set 2 V +1 02/29/24, 08:55 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/53703

  5. Garvin Hicking commented on patch set 2 CR +1 V +1 03/01/24, 08:01

    I wasn't actually able to reproduce the race condition here (even with simulated slow network, neither with v12 nor v13), so I couldn't verify the fix. Do you have a way to forcibly reproduce that? Otherwise, with the patch applied the mounting still works for me (v13), and the way I read the code I can see what it should be able to fix. (What I could see that a previous "double flashing" of the tree panel no longer happens)
  6. Andreas Kienast commented on patch set 2 03/01/24, 08:27

    Reply

    I couldn't forcibly reproduce that either, but I received a screen recording. When opening the browser console, you can see that on both, mounting and unmounting, two concurrent requests to `ajax/page/tree/fetchData` are sent.
  7. Benni Mack commented on patch set 2 03/01/24, 09:37

    tbh, I wouldn't fix this in 11.5
  8. Andreas Kienast commented on patch set 2 03/01/24, 09:58

    Reply

    Why? Because it wasn’t reported earlier or it‘s old-stable?
  9. Benni Mack commented on patch set 2 03/01/24, 10:32

    Reply

    old-stable
  10. Andreas Kienast commented on patch set 2 03/01/24, 10:52

    Reply

    Acknowledged
  11. Andreas Kienast updated the commit message in patch set 3 CR +1 V +1 03/01/24, 10:52

  12. Garvin Hicking voted on patch set 3 CR +1 V +1 03/01/24, 10:52

  13. core-ci voted on patch set 3 V +1 03/01/24, 10:57 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/53747

  14. Benjamin Kott voted on patch set 3 CR +1 V +1 03/04/24, 07:54

  15. Andreas Kienast voted on patch set 3 CR +2 V +2 03/04/24, 07:54

  16. Andreas Kienast merged patch set 4 03/04/24, 07:54