fix frozen time bounds on the recordings API (#24121)

`after` and `before` defaulted to `datetime.now()` in the function signature, so they were evaluated once at import. Requests that omitted them got a window ending at process start. They now resolve in the handler.
This commit is contained in:
Josh Hawkins
2026-09-12 07:30:04 -06:00
committed by Nicolas Mowen
parent e2da7aae99
commit 9416e74aeb
4 changed files with 38 additions and 10 deletions
+4 -5
View File
@@ -410,11 +410,10 @@ def enrich(spec: dict, access_map: dict) -> tuple[dict, list, list]:
# Numeric defaults at or above this magnitude are treated as live Unix
# timestamps baked into the schema at import time (e.g. the /{camera_name}
# /recordings after/before params default to datetime.now()). They make the
# export non-deterministic and document a meaningless frozen epoch, so they are
# stripped. The proper fix is to default those route params to None and resolve
# "now" inside the handler.
# timestamps baked into the schema at import time. They make the export
# non-deterministic and document a meaningless frozen epoch, so they are
# stripped. No route defaults this way today, and route params that need "now"
# resolve it inside the handler. Kept as a guard against the pattern returning.
VOLATILE_DEFAULT_THRESHOLD = 1_000_000_000