Review main Merged

88645[BUGFIX] Ensure scheduler task start/end time is integer

Garvin Hicking CR +2 V +2 Easy +20 −20 updated 03/21/25, 07:51

Commit message

With #104765, harmonization of the timestamps of scheduler tasks
has been introduced to fix timezone offsetting.

Unfortunately, the `getStart()` and `getEnd()`
methods are not type-enforced, and their type-hints may contradict
actual values coming from unserialisation.

This patch forces to return an integer for
these values.

Review

  • Code review CR +2 Done
    • Benjamin Franzke +2
    • Georg Ringer +1
    • Thomas Hohn +1
    • Oliver Klee +1
  • Verified V +2 Done
    • Benjamin Franzke +2
    • Georg Ringer +1
    • Thomas Hohn +1
    • core-ci +1 CI

Issues 2

Files 1

Review log 2326

Show 1 earlier messages
  1. Garvin Hicking uploaded patch set 1 03/18/25, 18:21

  1. core-ci voted on patch set 1 V +1 03/18/25, 18:29 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/75787

  2. Benjamin Franzke commented on patch set 1 CR +1 03/18/25, 18:54

    Nah, phpstan treats all phpdoc's as certain [1], therefore all users implied enforced types (which is why we were not notified by phpstan about this problem) +1 from my side [1] https://phpstan.org/config-reference#treatphpdoctypesascertain
  3. Thomas Hohn voted on patch set 1 CR +1 03/18/25, 19:15

  4. Garvin Hicking updated the commit message in patch set 2 CR +1 V +1 03/19/25, 06:15

  5. Garvin Hicking commented on patch set 2 03/19/25, 06:17

    Reply

    Ack. Probably higher PHPStan levels might complain about this approach, but then, higher levels would also complain about missing types.
  6. core-ci voted on patch set 2 V +1 03/19/25, 06:24 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/75807

  7. Thomas Hohn voted on patch set 2 CR +1 03/19/25, 06:39

  8. Mathias Brodala commented on patch set 2 03/19/25, 07:40

    For completeness: why not do the normalization in set*() instead? That's the point of setters, to ensure integrity.
  9. Benjamin Franzke commented on patch set 2 CR +1 V +1 03/19/25, 07:41

    Thanks! Verified by enforcing an empty string instead of `0` in `SchedulerTaskRepository::update` via `$task->getExecution()->setEnd('')`. Btw, I noticed that v11 used to write `''` instead of `0`, therefore we're basically handling records from v11 here.
  10. Benjamin Franzke commented on patch set 2 03/19/25, 07:43

    Reply

    "instead" would not suffice (as the task is deserialized from database values where empty strings were stored in v11), but we could additionally enforce types in the setters, yes.
  11. Mathias Brodala commented on patch set 2 03/19/25, 08:28

    Reply

    I feared that the dreaded serialization of tasks could interfere again, thanks for confirming.
  12. Oliver Klee voted on patch set 2 CR +1 03/19/25, 09:11

  13. Thomas Hohn voted on patch set 2 V +1 03/19/25, 09:16

  14. Christian Kuhn voted on patch set 2 CR +1 V +1 03/19/25, 11:40

  15. Benni Mack commented on patch set 2 03/19/25, 11:52

    Execution.php:101

    how about with cast the $this->end = (int)$end; as well?

    Execution.php:131

    same here please (for consistency)
  16. Garvin Hicking commented on patch set 3 CR +1 V +1 03/19/25, 12:20

    Published edit on patch set 2.
  17. core-ci voted on patch set 3 V +1 03/19/25, 12:30 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/75831

  18. Oliver Klee voted on patch set 3 CR +1 03/19/25, 12:37

  19. Garvin Hicking commented on patch set 3 03/19/25, 15:29

    Execution.php:101 Reply

    I think if we go down this rabbithole, we should fully cover everything. Which I did. wdyt?

    Execution.php:131 Reply

    Done
  20. Benni Mack commented on patch set 3 03/19/25, 16:14

    Execution.php:101 Reply

    fine by me! thanks!
  21. Thomas Hohn voted on patch set 3 CR +1 V +1 03/19/25, 19:36

  22. Georg Ringer voted on patch set 3 CR +1 V +1 03/20/25, 06:11

  23. Benjamin Franzke voted on patch set 3 CR +1 03/20/25, 13:20

  24. Benjamin Franzke voted on patch set 3 CR +2 V +2 03/21/25, 07:41

  25. Benjamin Franzke merged patch set 4 03/21/25, 07:51