Skip to content
This repository was archived by the owner on Aug 7, 2026. It is now read-only.

fix: omit null table from postgres_changes join payload - #77

Merged
Tr00d merged 1 commit into
masterfrom
nullvaluehandling
Aug 6, 2026
Merged

Tr00d merged 1 commit into
masterfrom
nullvaluehandling

Conversation

@Tr00d

@Tr00d Tr00d commented Aug 6, 2026 •

Copy link
Copy Markdown
Contributor

What

A schema-wide postgres_changes listener has no table, so Table is null.
That was serialized into the join config.postgres_changes payload as
"table": null, whereas the server expects the key to be absent. Adding
NullValueHandling.Ignore drops the key when Table is null.

// before — schema-wide listener
{ "event": "*", "schema": "public", "table": null }
// after
{ "event": "*", "schema": "public" }

Why

Sending "table": null is not the shape the realtime server expects for a
schema-wide subscription; omitting the key matches the reference realtime-js
config object, where an absent table means "every table in the schema."

Wire-shape change

This changes the serialized join payload for schema-wide listeners only
("table": null → key omitted). Listeners that specify a table are unaffected.
Called out here for reviewers; the package has no payload snapshot suite, so
there is nothing to re-approve.

Relationship to #54

Third of three focused PRs carved out of the stale draft #54, rebased onto
current master and brought to standard. #54 bundled this attribute change
with an unrelated [Obsolete] on PostgresChangesOptions.Parameters; that
deprecation is intentionally left out of this PR and deferred to the follow-up
that retires the two-step postgres_changes API.

Testing

  • PostgresChangesOptionsTests (hermetic serialization): table is omitted
    when null, and serialized when provided. Verified the null case catches the
    regression — pre-fix it fails with the table key present.
  • Full realtime suite green (45/45). Clean build, zero new warnings.

A schema-wide listener has no table, so Table is null — but it serialized
as "table": null in the join config.postgres_changes payload, whereas the
server expects the key to be absent. Add NullValueHandling.Ignore so a null
table is dropped, matching realtime-js.
@Tr00d
Tr00d merged commit 87b1a8b into master Aug 6, 2026
1 check passed
@Tr00d
Tr00d deleted the nullvaluehandling branch August 6, 2026 12:35
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant