mirror of
https://github.com/element-hq/synapse.git
synced 2026-08-16 02:30:26 +00:00
Synapse binds some binary values (e.g. slices of event data) as a `memoryview` rather than `bytes`/`bytearray`. The shim's `from_py` handled the latter two but not `memoryview`, so those parameters raised `TypeError: unsupported parameter type for postgres: memoryview` — e.g. persisting an event over federation (seen via `test_third_party_rules.test_on_new_event`). Accept a `memoryview` as a BYTEA parameter, copying its bytes out with `tobytes()` (the buffer protocol isn't available under the limited ABI the crate builds against). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01W3G4M92AmwSSZCbmtMJU3d