Conversation
There was a problem hiding this comment.
1 issue found across 2 files
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="fern/pages/websockets-quickstart.mdx">
<violation number="1" location="fern/pages/websockets-quickstart.mdx:20">
P1: Inconsistent event discriminator: `event.type` is checked for the subscribed case but `event.eventType` for the message-received case. If the SDK uses a single discriminant field, one of these checks is wrong and the corresponding branch will never execute. Verify the SDK's actual event shape and use a consistent property name.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
| socket.on("message", async (event) => { | ||
| if (event.type === "subscribed") { | ||
| console.log("Subscribed to", event.inboxIds); | ||
| } else if (event.eventType === "message.received") { |
There was a problem hiding this comment.
P1: Inconsistent event discriminator: event.type is checked for the subscribed case but event.eventType for the message-received case. If the SDK uses a single discriminant field, one of these checks is wrong and the corresponding branch will never execute. Verify the SDK's actual event shape and use a consistent property name.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At fern/pages/websockets-quickstart.mdx, line 20:
<comment>Inconsistent event discriminator: `event.type` is checked for the subscribed case but `event.eventType` for the message-received case. If the SDK uses a single discriminant field, one of these checks is wrong and the corresponding branch will never execute. Verify the SDK's actual event shape and use a consistent property name.</comment>
<file context>
@@ -0,0 +1,50 @@
+ socket.on("message", async (event) => {
+ if (event.type === "subscribed") {
+ console.log("Subscribed to", event.inboxIds);
+ } else if (event.eventType === "message.received") {
+ console.log(`Received message from: ${event.message.from}`);
+ }
</file context>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a new WebSockets Quickstart page with TypeScript and Python code examples under the WebSockets section.
Link to Devin run
Requested by: Fern Support (info@buildwithfern.com)
Summary by cubic
Added a WebSockets Quickstart page with TypeScript and Python examples to help users stream real-time email events. Updated docs navigation to include the Quickstart under the WebSockets section.
Written for commit 352dab6. Summary will update on new commits.