Skip to content
Snippets Groups Projects
  1. Oct 19, 2023
  2. Oct 18, 2023
  3. Oct 17, 2023
  4. Oct 16, 2023
  5. Oct 15, 2023
  6. Oct 14, 2023
    • Benni Mack's avatar
      [TASK] FAL: Task object cleans up processing configuration · c5985480
      Benni Mack authored
      Within the FileProcessingService class,
      various cleanups regarding the configuration array
      were made in order to avoid duplicate processed files.
      
      However, as noted in the existing code, this actually
      are special cases for specific tasks (ensuring that
      width and height are actually integers and have max
      boundaries in ImagePreviewTask for example).
      
      There is a culprit though, when moving this to
      the actual Task Objects (and that might be the
      reason why it was implemented the way it was):
      
      First, there is the ProcessedFile object, which
      then has a ->getTask() call, which then builds the
      Task object. The Task object thus needs a ProcessedFile
      object.
      
      But the ProcessedFile object is created AFTER it was
      checked in the DB based on the given configuration
      (which needs to be sanitized first to avoid duplicates),
      so a classic Chicken Egg problem.
      
      In the ideal world, the Task object should not hold state
      anymore, but write everything back to the ProcessedFile
      (e.g. configuration) as this is still duplicated in the
      current state.
      
      So, to reduce the interwoven situation, the AbstractTask object
      now has a new option called sanitizeConfiguration() which
      at a later point should be part of the interface (= breaking),
      but then also work with the ProcessedFile->getProcessingConfiguration()
      directly to reduce the duplication of memory everywhere.
      
      For the time being, an intermediate (empty) ProcessedFile
      is created, a Task object is instantiated and the configuration
      is sanitized (in the ProcessedFileRepository),
       when checking in the DB if a DB entry is available.
      
      The final ProcessedFile object is re-created after the DB
      query, which contains the sanitized configuration array.
      
      This change adds a new method to the Tasks, and adds some
      checks regarding the method, however this should go in
      the interface.
      
      As the interface will be cleaned up anyways in v13, this
      will be added separately in the next steps and the breaking
      change will follow as next patch.
      
      Resolves: #102164
      Releases: main
      Change-Id: I01d5bef97a2fa319c1bffacacf28db6ca3f9b7a3
      Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/81153
      
      
      Tested-by: default avatarAnja Leichsenring <aleichsenring@ab-softlab.de>
      Tested-by: default avatarBenni Mack <benni@typo3.org>
      Reviewed-by: default avatarBenni Mack <benni@typo3.org>
      Tested-by: default avatarcore-ci <typo3@b13.com>
      Tested-by: default avatarStefan Bürk <stefan@buerk.tech>
      Reviewed-by: default avatarStefan Bürk <stefan@buerk.tech>
      Reviewed-by: default avatarAnja Leichsenring <aleichsenring@ab-softlab.de>
      c5985480
  7. Oct 12, 2023
  8. Oct 11, 2023