userli icon indicating copy to clipboard operation
userli copied to clipboard

Recovery process: Wrong calculation of waiting period

Open doobry-systemli opened this issue 5 years ago • 2 comments

Apparently there's a bug in calculating the waiting period for recovery processes. When starting the recovery process, I get told that I have to wait at least 48 hours, but at the same time I'm told that the second step is possible earliest in five days from now: The displayed timestamp is five days in the furture, not two.

doobry-systemli avatar Apr 29 '20 11:04 doobry-systemli

Interestingly, after reloading the recovery process page, the correct timestamp is displayed: 48 hours (two days) after the process has been started.

doobry-systemli avatar Apr 29 '20 11:04 doobry-systemli

Well, the problem seems to be that DateTime::add() manipulates the underlying DateTime object.

Since we execute $time->add(new \DateInterval('P2D')) twice in the first run (once in RecoveryProcessMessageSender and once in RecoveryController), the timestamp after the second invocation has four days added, not two.

I didn't find a good solution to fix this yet.

doobry-systemli avatar May 03 '20 17:05 doobry-systemli

This got fixed as part of #570.

doobry-systemli avatar Mar 30 '24 11:03 doobry-systemli