sot / kadi

Chandra commands and events
https://sot.github.io/kadi
BSD 3-Clause "New" or "Revised" License
5 stars 3 forks source link

Fix issue with cmd query around 30 days before current time #265

Closed taldcroft closed 1 year ago

taldcroft commented 1 year ago

Description

This fixes a bug in the get_cmds query logic which resulted in missing commands from the query under somewhat unusual circumstances:

The basic problem is that the code was checking for the first command of any type in the recent commands. Instead it should have been checking for the first load command in recent commands (within 30 days).

The unit test demonstrates the problem as it applies for a current date of 2022:352. In this case the OORMPEN non-load command at 2022:312:03:09:55.000 causes the problem.

Interface impacts

None

Testing

Added unit test which failed prior to the fix and passes now.

Unit tests

Independent check of unit tests by Jean

Functional tests

No functional testing.