mirror of
https://github.com/element-hq/synapse.git
synced 2026-08-17 08:50:57 +00:00
The value mapping bound arrays as parameters (a `list` → `Array`) but couldn't decode an array *column* back out — the decode side assumed "Synapse only binds arrays as parameters". That assumption was wrong: the caches replication stream reads `keys` (a `text[]`) via `get_all_updated_caches`, so decoding failed with "error deserializing column", the stream read errored, and a worker never received bulk cache invalidations (the `wait_for_stream_position` in the test hung and never fired). Decode an array column into a Python `list`, each element decoded by the array's element type (via `array_from_sql`); `PythonPgFromSql::accepts` now also accepts arrays of a supported scalar element type, mirroring `PgValue`'s `ToSql`. The Rust-native `DbValue` decoder stays scalar-only — nothing reads array columns through it. Adds `fallible-iterator` (the version postgres-protocol already uses) to iterate the decoded array's elements. Fixes tests.storage.databases.main.test_cache.CacheInvalidationOverReplication's test_bulk_invalidation_replicates on the Rust backend. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01W3G4M92AmwSSZCbmtMJU3d