Skip to content

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

Open
Ayush7614 wants to merge 1 commit into
CopilotKit:mainfrom
Ayush7614:fix/live-screen-null-payload-guard
Open

fix(app): guard live screen socket against non-object payloads#388
Ayush7614 wants to merge 1 commit 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.

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