Review main Abandoned

66098[BUGFIX] file spool sends messages multiple times

Christoph Lehmann CR 0 V 0 Easy +3 −3 updated 09/23/21, 06:36

Commit message

When this patch is applied, the file spool does not save and send  messages multiple times in case of success.

Review

  • Code review CR 0
  • Verified V 0

Issues 1

Files 1

Review log 911

  1. Christoph Lehmann uploaded patch set 1 10/10/20, 18:52

  2. TYPO3com voted on patch set 1 V -1 10/10/20, 18:53 Completed build in 21s on Sat, 10 Oct, 06:53 PM Test Summary: No tests found Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-6425

  3. Christoph Lehmann uploaded patch set 2 10/10/20, 19:06

  4. TYPO3com voted on patch set 2 V +1 10/10/20, 19:27 Completed build in 19m 58s on Sat, 10 Oct, 07:27 PM Test Summary: 73734 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-6429

  5. Alexander Schnitzler commented on patch set 2 10/11/20, 12:35

    Can you please explain what the issue was and how it is fixed now? By just looking at the code change I don't understand the fix.
  6. Christoph Lehmann commented on patch set 2 10/12/20, 08:36

    > Patch Set 2: > > Can you please explain what the issue was and how it is fixed now? By just looking at the code change I don't understand the fix. fopen with 'x' fails, if the file already exists; The break is needed to end the loop after first successful write.
  7. Alexander Schnitzler commented on patch set 2 10/12/20, 10:23

    > Patch Set 2: > > > Patch Set 2: > > > > Can you please explain what the issue was and how it is fixed now? By just looking at the code change I don't understand the fix. > > fopen with 'x' fails, if the file already exists; The break is needed to end the loop after first successful write. Alright, got it. Just an idea but what do you think about this refactored approach: https://gist.github.com/alexanderschnitzler/d0eb1191e9eaf9dae01871be25077ab4 That way, the loop is only used for generating a non existing file name and two additional Exceptions are thrown. Personally, I find that method more meaningful and easier to read. wdyt?
  8. Christoph Lehmann commented on patch set 2 10/12/20, 14:51

    > Patch Set 2: > > > Patch Set 2: > > > > > Patch Set 2: > > > > > > Can you please explain what the issue was and how it is fixed now? By just looking at the code change I don't understand the fix. > > > > fopen with 'x' fails, if the file already exists; The break is needed to end the loop after first successful write. > > Alright, got it. Just an idea but what do you think about this refactored approach: > https://gist.github.com/alexanderschnitzler/d0eb1191e9eaf9dae01871be25077ab4 > > That way, the loop is only used for generating a non existing file name and two additional Exceptions are thrown. Personally, I find that method more meaningful and easier to read. wdyt? I'm fine with your variant and it's fine for me when you create another patchset. What i really ask me is why do we try to find a unique filename here and the function \TYPO3\CMS\Core\Utility\File\BasicFileUtility::getUniqueName() is deprecated... :-)
  9. Simon Gilli commented on patch set 2 CR -1 10/13/20, 18:39

    This does not look correct, imho only adding the break will do it. But I vote for Alexander's proposition. And then we also should add a functional test here.
  10. Simon Gilli commented on patch set 2 10/14/20, 12:07

    Working on the fix here https://review.typo3.org/c/Packages/TYPO3.CMS/+/66139. Currently there are issues with Bamboo and I pushed only the tests with the first PS, will push the fix once Bamboo is running again and the first PS was completely tested (12 failures are expected). So this patch can be abandoned.
  11. Benni Mack abandoned the change 09/23/21, 06:36