Review main Merged

92579[BUGFIX] Enhance message handler registration to support multiple types

Sascha Nowak CR +2 V +2 Hard +460 −43 updated 02/03/26, 16:07

Commit message

The following use cases are covered:
* Single handler with single message with class attributes
* Single handler with multiple messages with class attributes
* Single handler with single message with method attributes
* Single handler with multiple messages with method attributes
* Multiple handlers for the same message
* Multiple handlers in a single class with class attributes
* Multiple handlers in a single class with method attribute

Tests are now added for a message handler bus test.

Also, casual changes to harmonize the ListenerProviderPass
in types and annotations is performed.

Review

  • Code review CR +2 Done
    • Garvin Hicking +2
    • Moritz Ngo +1
    • Sascha Nowak +1
  • Verified V +2 Done
    • Garvin Hicking +2
    • Moritz Ngo +1
    • Sascha Nowak +1
    • core-ci +1 CI

Issues 1

Files 17

Review log 1925

  1. Sascha Nowak uploaded patch set 1 01/29/26, 20:15

  2. Sascha Nowak commented on patch set 1 01/29/26, 20:22

    If anyone likes to test it, here are the classes I used to test the compiler https://gist.github.com/saschanowak/598956c78e1ae2165f2f74074284860c
  3. Sascha Nowak uploaded patch set 2 01/29/26, 20:31

  4. Garvin Hicking commented on patch set 1 01/29/26, 20:35

    Looks promising, we should add a fixture extension plus functional test for it.

    MessageHandlerPass.php:78

    Let's try to avoid empty in favor of !==[] && != null && != '' for more strictness, even though it's more code, the empty() magic is problematic
  5. core-ci voted on patch set 2 V +1 01/29/26, 20:39 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/94599

  6. Sascha Nowak uploaded patch set 3 V +1 01/29/26, 20:50

  7. Sascha Nowak commented on patch set 2 01/29/26, 20:51

    Reply

    This would be great, but THB I have no idea how to test the output of the symfony DI cache file

    MessageHandlerPass.php:78 Reply

    Done
  8. core-ci voted on patch set 1 V -1 01/29/26, 20:51 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/94598

  9. core-ci voted on patch set 3 V +1 01/29/26, 21:00 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/94601

  10. Garvin Hicking commented on patch set 3 01/29/26, 21:50

    Reply

    I was more thinking of putting real message handler registrations in the fixture and let them each operate on a message in one functional test, and in the end check if the mesagee has all the variations applied that each handler would add?
  11. Moritz Ngo commented on patch set 3 CR +1 V +1 01/30/26, 03:28

    awesome, I've added the patch and tested the changes in my project with that specific use case and it works like charm
  12. Moritz Ngo commented on patch set 3 01/30/26, 03:32

    ListenerProviderPass.php:78

    I was wondering why you're now checking the types explicitly, using `empty` should do the same thing, or am I missing something?
  13. Garvin Hicking commented on patch set 3 01/30/26, 05:45

    ListenerProviderPass.php:78 Reply

    Yes, we try to avoid using empty() - see my comment earlier here.
  14. Garvin Hicking uploaded patch set 4 CR +1 V +1 01/30/26, 20:55

  15. core-ci voted on patch set 4 V -1 01/30/26, 21:05 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/94710

  16. Garvin Hicking uploaded patch set 5 V -1 01/30/26, 21:22

  17. core-ci voted on patch set 5 V +1 01/30/26, 21:31 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/94711

  18. Garvin Hicking commented on patch set 6 V +1 01/30/26, 21:35

    Published edit on patch set 5.
  19. Garvin Hicking commented on patch set 6 CR +1 V +1 01/30/26, 21:37

    Reply

    Please check out my test proposal, even though it looks much it's rather light weight and just "proves" that your adaptations work great (for me and the cases you provided) 😊
  20. core-ci voted on patch set 6 V +1 01/30/26, 21:43 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/94712

  21. Moritz Ngo commented on patch set 6 CR +1 V +1 02/02/26, 15:32

    Reply

    Yeah, that looks quite complicated at first glance, but it's well thought out and looks good to me 😊
  22. Sascha Nowak voted on patch set 6 CR +1 V +1 02/03/26, 13:29

  23. Sascha Nowak commented on patch set 6 02/03/26, 13:31

    Reply

    Done
  24. Garvin Hicking voted on patch set 6 CR +2 V +2 02/03/26, 13:32

  25. Garvin Hicking merged patch set 7 02/03/26, 16:07