Store rejections.last_check as text, matching its column type

`rejections.last_check` is a TEXT column, but both writers stored
`clock.time_msec()` (an int) into it, relying on the driver to coerce int→text.
The native Rust driver binds typed parameters and rejects that (error
serializing parameter), so marking an event rejected failed — e.g. paginating
through rejected events (test_room_messages_paginate_through_rejected_events).

Store the timestamp as a string, matching the declared TEXT column, rather than
reintroducing loose int/text coercion in the shim. psycopg2 and sqlite are
unaffected (a text value is equally valid there).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01W3G4M92AmwSSZCbmtMJU3d
This commit is contained in:
Erik Johnston
2026-07-06 10:14:31 +00:00
co-authored by Claude Opus 4.8
parent 57883548ce
commit 92551eb13e
2 changed files with 6 additions and 2 deletions
+3 -1
View File
@@ -3513,7 +3513,9 @@ class PersistEventsStore:
values={
"event_id": event_id,
"reason": reason,
"last_check": self._clock.time_msec(),
# `last_check` is a TEXT column, so store the timestamp as a
# string rather than relying on the driver to coerce an int.
"last_check": str(self._clock.time_msec()),
},
)
@@ -2702,7 +2702,9 @@ class EventsWorkerStore(SQLBaseStore):
keyvalues={"event_id": event_id},
values={
"reason": rejection_reason,
"last_check": self.clock.time_msec(),
# `last_check` is a TEXT column, so store the timestamp as a
# string rather than relying on the driver to coerce an int.
"last_check": str(self.clock.time_msec()),
},
)
self.db_pool.simple_update_txn(