|
Ran
|
Files
42
|
Run time
1s
|
Badge
README BADGES
|
push
github
fix(realtime): accept postgres change error arrays (#1908) ## Why Closes #1907. Realtime sends PostgreSQL change errors as arrays, including `Error 413: Payload Too Large`. The Python listener validates `errors` as a string and drops the entire change before its callback runs. ## What changed - Accept string arrays in `PostgresChangesData.errors` while preserving existing string and null values. - Add real local WebSocket tests for INSERT, UPDATE, and DELETE callbacks, including partial row identity and scalar/null compatibility. ## Scope This changes one shared payload type. Message routing and callback APIs are unchanged. ## Tradeoffs The [current server](https://github.com/supabase/realtime/blob/<a class=hub.com/supabase/supabase-py/commit/c8bdfb6979e4d7633176f41f81cd49c7aaa64cee">c8bdfb697/lib/extensions/postgres_cdc_rls/replication_poller.ex#L321) and its [UPDATE fixture](https://github.com/supabase/realtime/blob/c8bdfb6979e4d7633176f41f81cd49c7aaa64cee/test/extensions/postgres_cdc_rls/replication_poller_test.exs#L902) use arrays. The protocol docs describe string or null, so those already accepted forms remain supported. ## Blast radius The existing decoder can now deliver changes that carry error arrays. The tests retain the exact error values and row identity through the public subscription callback. ## Verification - `.venv/bin/python -m pytest src/realtime/tests/test_postgres_changes.py -q` produced `3 failed` before the type fix and `3 passed` after it. A separate public WebSocket reproduction went from two discarded frames to zero. - 47 local Realtime tests passed across the offline suite and eight selected Presence cases. The broader suite retains pre-existing `AsyncPush.start_timeout` shutdown warnings; the new WebSocket tests produce none. - `make realtime.mypy`, repository Ruff lint/format checks, `git diff --check`, and `uv build --package realtime` passed. `make realtime.tests` was not run because Docker is unavailable. The tests use service-derived messages over a controlle... (continued)
2706 of 2816 relevant lines covered (96.09%)
0.96 hits per line
| Coverage | ∆ | File | Lines | Relevant | Covered | Missed | Hits/Line |
|---|