test(realtime): cover automatic and lightweight Postgres changes - #169
Conversation
|
@codex review. Please review code and security on the current head. SDK-REALTIME-004 compares authenticated automatic row loading and lightweight INSERT/UPDATE delivery, including metadata, event/table filtering, ten-second waits, and cleanup. Current 21/proposed38 copies and all38 registrations pass; native, generation, package and docs checks pass. Coordinated PRs: JS #137, Python #169, Ruby #151. Hosting #1127 holds the canonical scenario and owner-RLS table and merges last. No live pass is claimed for the new staged case. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
🛡️ Codex Security Review · Automatically triggeredSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 13f519883e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| def record(self, change: PostgresChange) -> None: | ||
| self.events.append(change) | ||
| self.queue.put_nowait(change) |
There was a problem hiding this comment.
Ignore notifications for other contract rows
When two contract runs use the same authenticated fixture user and shared realtime table concurrently, this callback enqueues every table event without checking the UUID generated for this scenario. An unrelated INSERT or UPDATE can therefore be returned by next() first, causing identity/order assertions to fail even though this run's notification arrives within the deadline; later unrelated events also pollute events. Filter on event.record["id"] for automatic delivery or event.id for lightweight delivery before recording the change.
Useful? React with 👍 / 👎.
|
@codex review. Please rerun code and security reviews on the new head. Each observer now filters by the scenario UUID before recording wildcard, INSERT-only, or wrong-table callbacks. Automatic event assertions also require cleared lightweight fields. Native regression cases failed before the fixes and pass now. Ruby additionally enforces one ten-second deadline across both observers with a deadline regression. JavaScript fixes the remaining Postgres channel examples and its TypeScript reference. Native suites pass: JavaScript 700, Python 1116, Ruby 1010; lint, types, package checks, docs lint and all 38 scenario registrations pass. |
🛡️ Codex Security Review · Automatically triggeredSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
|
Codex Review: Didn't find any major issues. Keep it up! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Stage SDK-REALTIME-004 for authenticated Postgres insert/update delivery. Two clients compare automatic row loading with lightweight row-ID notifications, checking exact row values, metadata, event order, and event/table filters. Each observation has a ten-second deadline and the inserted row has registered cleanup.
Document that automatic lookup requires an
idprimary key and returns the current row, and thatauto_fetch=Falseis selected when creating the channel. Existing active contract files stay unchanged.Validation: 1,112 native tests; lint, mypy, pyright, deterministic generation, wheel/sdist build, isolated installed package smoke, and docs lint pass. Three notification-validator regressions reject wrong rows, IDs, or tables. All 38 proposed scenarios / 211 steps register in Behave dry-run; current 21 / proposed 38 feature copies validate across all three SDKs. Live validation follows dependency merges.
Coordinated branch:
skeever/sdk-postgres-contract. Hosting #1127 supplies the canonical feature and isolated owner-RLS table; SDK dependencies merge first and Hosting remains the cumulative PR that merges last.