From 7a56818213127eeef78888049911077832aa686c Mon Sep 17 00:00:00 2001 From: stroblme Date: Thu, 15 Oct 2026 10:57:41 +0200 Subject: [PATCH] Pin the UTC offset on the time a flow version carries Every datetime the API emits for versions (flow summaries' updated_at, runs' created/started/finished with flow_version) is already ISO 8601 with Z or +00:00. A test holds it and the API docs say so. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01WgBfkm4rCmtd1T4vHWjEPx --- backend/tests/api/routes/test_flows.py | 5 +++++ docs/code/api.md | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/backend/tests/api/routes/test_flows.py b/backend/tests/api/routes/test_flows.py index b2cb0d7..692a3a2 100644 --- a/backend/tests/api/routes/test_flows.py +++ b/backend/tests/api/routes/test_flows.py @@ -62,6 +62,11 @@ def test_save_then_read_flow( assert body["definition"]["title"] == "Demo" assert {node["id"] for node in body["definition"]["nodes"]} == {"sensor", "logger"} + # The time beside a version carries its offset, so no client guesses a zone. + listed = client.get(f"{PREFIX}/", headers=superuser_token_headers).json()["data"] + summary = next(flow for flow in listed if flow["name"] == "demo") + assert datetime.fromisoformat(summary["updated_at"]).tzinfo is not None + def test_name_mismatch_is_rejected( client: TestClient, superuser_token_headers: dict[str, str] diff --git a/docs/code/api.md b/docs/code/api.md index 84f42cd..2e002ad 100644 --- a/docs/code/api.md +++ b/docs/code/api.md @@ -12,7 +12,8 @@ export FLUKSIO=http://127.0.0.1:8000/api/v1 Use the port printed by `fluksio serve`. For Docker, use `http://api.localhost/api/v1`, `http://:8080/api/v1` on a LAN stack, or `https://api./api/v1` for a deployment. -All paths below are relative to this base. +All paths below are relative to this base. Timestamps in responses are +ISO 8601 and always carry their UTC offset. ## Authenticating