Add custom event remote session proto#1610
Conversation
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e58f245a86
ℹ️ 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".
| function dictToStruct(data: Record<string, unknown>): Struct { | ||
| return Struct.fromJson(data); |
There was a problem hiding this comment.
Validate custom-event payload before Struct conversion
dictToStruct() passes Record<string, unknown> directly into Struct.fromJson(), but this API only accepts JSON-compatible values. Because the new public payload type permits non-JSON data (for example { foo: undefined }, Date, bigint, or functions), emitting a custom event can throw synchronously in onCustomEvent, which can break event forwarding for the session at runtime. Tightening the type to a JSON object (or sanitizing/rejecting unsupported values before conversion) avoids this runtime failure mode.
Useful? React with 👍 / 👎.
No description provided.