PreviewUriBuilder::getAdditionalQueryParametersForAccessRestrictedPages()
decides second-exact whether ADMCMD_simTime has to be added, while the
frontend evaluates page visibility against the 'accessTime' of the date
aspect, which has a precision of 60 seconds by design - see
PageRepository::getDefaultConstraints() and
SystemEnvironmentBuilder::initializeGlobalTimeTrackingVariables().
Due to that mismatch both branches fail for a 'starttime' carrying
seconds. With a 'starttime' of 09:13:21:
* At 09:13:45 the condition is false, no ADMCMD_simTime is emitted and
the frontend compares 09:13:21 <= accessTime (09:13:00). The page is
not found and the preview ends in a 404 with PAGE_NOT_FOUND.
* At 09:12:00 the condition is true and ADMCMD_simTime=09:13:21 is
emitted, but PreviewSimulator::simulateDate() derives SIM_ACCESS_TIME
as $queryTime - $queryTime % 60, which is 09:13:00 again and still
below 'starttime' - a 404 as well.
The branch meant to compensate for a 'starttime' in the future can
therefore not succeed at all while the value carries seconds; the
preview only starts working once the clock passes 09:14:00. Editors hit
this without a way to see why, since 'starttime' is declared
format=datetime, whose picker neither displays nor allows editing
seconds, while its "Today" shortcut stores the live wall-clock second.
The simulated time is now rounded up to the first full minute the record
is live at. That is a no-op for every record with starttime % 60 === 0,
which is everything that works today, and no stored data is touched. The
'endtime' branch needs no adjustment: flooring endtime - 1 still
satisfies the endtime > accessTime constraint. The workspaces preview
uses the same method and benefits alike.
Functional tests are added for both failure modes, for the cases that
behave unchanged and for the 'endtime' branch, none of which had
coverage before.
This patch was created with the support of coding agents.