Review 10.4 Merged

65418[BUGFIX] Streamline AjaxDataHandler event names

Andreas Kienast CR +2 V +2 Easy +26 −11 updated 09/04/20, 11:39

Commit message

The events dispatched by AjaxDataHandler are changed to be always named
`typo3:datahandler:process`. This is done to ease registering event
listeners as the executed action is part of the sent payload already.

Since this feature is not documented and propagated yet, this is
considered being not breaking.

Review

  • Code review CR +2 Done
    • Andreas Kienast +2
  • Verified V +2 Done
    • Andreas Kienast +2
    • TYPO3com +1 CI

Issues 1

Files 8

Review log 67

  1. Andreas Kienast commented on patch set 1 08/21/20, 16:12

    Cherry Picked from branch master.
  2. TYPO3com voted on patch set 1 V +1 08/21/20, 16:25 Completed build in 12m 12s on Fri, 21 Aug, 04:25 PM Test Summary: 74034 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC104-253

  3. Andreas Kienast voted on patch set 1 V +2 CR +2 08/21/20, 16:27

  4. Andreas Kienast merged patch set 2 08/21/20, 16:27

  5. Oliver Hader commented on patch set 2 09/01/20, 21:05

    Some remarks on AjaxDataHandler - did not check the others

    AjaxDataHandler.ts:97

    Hm... the broadcasted event is basically the same `typo3:datahandler:process` - thus, the event seems to be triggered twice, correct? * event names should be past tense, e.g. "processed" instead of "process" - or `process-succeeded` (see below) * this component is not the data handler, it's the AJAX data handler Considering the missing catch block for failed promises, we finally would have * `typo3:ajax-data-handler:process-succeeded` * `typo3:ajax-data-handler:process-failed` I'll have a look...
  6. Andreas Kienast commented on patch set 2 09/02/20, 05:37

    AjaxDataHandler.ts:97 Reply

    Yes, we trigger two events. The reason is that only the most-outer frame listens to Broadcast channel events. I tried to add the listener to the RecordList as well (that was my test case) which got completely ignored. I assume that Broadcast Channel events cannot be listened to when emitting and listening happens in the same frame.
  7. Oliver Hader commented on patch set 2 09/04/20, 11:39

    → is started a WIP for streamlining the scenario https://review.typo3.org/c/Packages/TYPO3.CMS/+/65578 → using in/required for https://github.com/FriendsOfTYPO3/sudo-mode/pull/5

    AjaxDataHandler.ts:97 Reply Unresolved

    > Yes, we trigger two events. The reason is that only the most-outer frame listens to Broadcast channel events. I tried to add the listener to the RecordList as well (that was my test case) which got completely ignored. I assume that Broadcast Channel events cannot be listened to when emitting and listening happens in the same frame. The document containing RecordList (I guess an IFRAME) would need to listen to the same broadcast channel as well (e.g. using BroadcastService.listen()).