Review main Abandoned

64838[BUGFIX] Avoid EventDispatcher from being serialized

Oliver Hader CR 0 V 0 Easy +22 −0 updated 06/08/20, 22:59

Commit message

EventDispatcher contains closures handling corresponding events which
cannot be serialized. This leads to problems for instance when having
a multi-step form containing file uploads.

Review

  • Code review CR 0
  • Verified V 0

Issues 1

Files 1

Review log 56

  1. Oliver Hader uploaded patch set 1 06/08/20, 09:36

  2. Benni Mack voted on patch set 1 V +1 CR +1 06/08/20, 09:46

  3. TYPO3com voted on patch set 1 V +1 06/08/20, 09:50 Completed build in 13m 37s on Mon, 8 Jun, 09:50 AM Test Summary: 72800 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-3883

  4. Benjamin Franzke commented on patch set 1 CR -2 06/08/20, 17:56

    EventDispatcher.php:59

    This violates inversion of control (see constructor). As discussed previously with the other mergers: Fixing each and every service/singleton to support serialization will be major maintenance/testing burden and will violate the inversion of control (IoC) principle that dependency injection is about to propagate (it violates because __wakeup will start to take control about dependencies as they need to be re-injected manually). Really, doing so in all the services would render dependency injection useless. The issue always boils down to the problem that data objects and services are mixed (like for LazyObjectStorage, or for domain models that inject/instantiate/reference services). Instead of introducing new behaviour for this clean service (which can only be reverted as a breaking change), we should fix the mixed data/service consumer objects (in the case of the reference bug, the extbase file reference model) to provide proper serialization support/cleanups. To back this up: We'd only be able to remove this IoC violation in version 12 as a breaking change (with deprecation in v11). Also depending on an interface (EventDispatcherInterface) and expecting it to be serializable also violates the concepts of interfaces and interchangable code.
  5. Benjamin Franzke commented on patch set 1 06/08/20, 20:05

    EventDispatcher.php:59 Reply Unresolved

    Please see https://review.typo3.org/c/Packages/TYPO3.CMS/+/64841 for an alternative approach that fixes the source of the problem (mixed data/service object FileReference).
  6. Oliver Hader abandoned the change 06/08/20, 22:59