Skip to content

fix(app): guard live screen socket against non-object payloads - #388

Merged
davidmckayv merged 4 commits into
CopilotKit:mainfrom
Ayush7614:fix/live-screen-null-payload-guard
Sep 6, 2026
Merged

fix(app): guard live screen socket against non-object payloads#388
davidmckayv merged 4 commits into
CopilotKit:mainfrom
Ayush7614:fix/live-screen-null-payload-guard

Conversation

@Ayush7614

Copy link
Copy Markdown
Contributor

The live-screen socket parsed every frame with a bare JSON.parse and read message.type directly. A non-object payload such as null throws a TypeError inside onmessage and stops the live view, while numbers/strings/arrays fall through without an explicit drop rule.

Parses as unknown and drops non-object JSON plus messages with a non-string type before touching type/data, mirroring the channel-socket payload guard. Verified: null/number/string/array/malformed frames all drop, valid frame and error frames still handled, app typecheck clean.

@davidmckayv davidmckayv left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Deep-reviewed against live code (correctness, governance, no vendor/secret/scale issues). Composed build+tests green. CHANGELOG/format rebase on CI-validated substance.

@davidmckayv
davidmckayv merged commit 4213cfd into CopilotKit:main Sep 6, 2026
14 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.

2 participants