fix(awooop): store outbound sent timestamp as naive utc
All checks were successful
Code Review / ai-code-review (push) Successful in 10s
CD Pipeline / tests (push) Successful in 1m17s
CD Pipeline / build-and-deploy (push) Successful in 3m51s
CD Pipeline / post-deploy-checks (push) Successful in 1m25s

This commit is contained in:
Your Name
2026-05-13 12:27:58 +08:00
parent 3a1cedc90d
commit 04c7bb1c97
3 changed files with 7 additions and 1 deletions

View File

@@ -489,7 +489,11 @@ async def record_outbound_message(
source_envelope_json = json.dumps(envelope, ensure_ascii=False, default=str)
actual_status = "shadow" if is_shadow else send_status
sent_at = datetime.now(UTC) if actual_status == "sent" else None
sent_at = (
datetime.now(UTC).replace(tzinfo=None)
if actual_status == "sent"
else None
)
await ensure_completed_shadow_run(
db,

View File

@@ -135,3 +135,4 @@ async def test_record_outbound_message_sets_sent_at_for_sent_messages() -> None:
assert ":sent_at" in insert_statement
assert session.param_sets[-1]["send_status"] == "sent"
assert session.param_sets[-1]["sent_at"] is not None
assert session.param_sets[-1]["sent_at"].tzinfo is None

View File

@@ -7308,5 +7308,6 @@ OK
- rollback transaction smoke 抓到 asyncpg bind parameter 型別推論問題:`CASE WHEN :send_status = 'sent'` 會被推成 text/varchar ambiguous。
- 第一版 `CAST(:send_status AS text)` 仍會因同一 bind param 同時插入 varchar 與比較而 ambiguous最終改成 Python 端計算 `sent_at` 參數SQL 只插入 `:sent_at`,避免 outbound mirror 在 production 寫入時失敗。
- 第二次 rollback smoke 抓到 DB 欄位是 `timestamp without time zone`,已改成 naive UTC `datetime.now(UTC).replace(tzinfo=None)`,避免 asyncpg timezone-aware bind 失敗。
**目前整體進度**:約 69%。