Skip to content

test(realtime): cover automatic and lightweight Postgres changes - #169

Merged
swkeever merged 3 commits into
mainfrom
skeever/sdk-postgres-contract
Sep 18, 2026
Merged

swkeever merged 3 commits into
mainfrom
skeever/sdk-postgres-contract

Conversation

@swkeever

Copy link
Copy Markdown
Collaborator

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 id primary key and returns the current row, and that auto_fetch=False is 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.

@swkeever

Copy link
Copy Markdown
Collaborator Author

@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.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 18, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-18T19:48:08.738078Z 6ca99f0 Manual request
🔒 Security Review ✅ Completed 2026-09-18T19:47:52.064508Z 6ca99f0 Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: 13f519883e

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +38 to +40
def record(self, change: PostgresChange) -> None:
self.events.append(change)
self.queue.put_nowait(change)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@swkeever

Copy link
Copy Markdown
Collaborator Author

@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.

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: 6ca99f061f

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

Reviewed commit: 6ca99f061f

ℹ️ 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".

@swkeever
swkeever marked this pull request as ready for review September 18, 2026 19:50
@swkeever
swkeever merged commit c618684 into main Sep 18, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant