Skip to content

Commit 5c4c49b

Browse files
committed
[Dashboard] Fix: Handle ping event (#7287)
<!-- ## title your PR with this format: "[SDK/Dashboard/Portal] Feature/Fix: Concise title for the changes" If you did not copy the branch name from Linear, paste the issue tag here (format is TEAM-0000): ## Notes for the reviewer Anything important to call out? Be sure to also clarify these in your comments. ## How to test Unit tests, playground, etc. --> This PR adds a simple `ping` case in the `promptNebula` function to avoid `console.warn` logs in the browser console. <!-- start pr-codex --> --- ## PR-Codex overview This PR adds support for a new event type, `"ping"`, in the `ChatStreamedEvent` type definition and handles the `"ping"` event case in the event processing logic. ### Detailed summary - Added a new case for `"ping"` in the event handling switch statement. - Introduced a new type definition for the `"ping"` event in the `ChatStreamedEvent` type, including a `data` field of type `string`. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex --> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Improved chat event handling with support for a new "ping" event type, enhancing the stability of real-time chat updates. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent a5cd664 commit 5c4c49b

File tree

1 file changed

+8
-0
lines changed
  • apps/dashboard/src/app/nebula-app/(app)/api

1 file changed

+8
-0
lines changed

apps/dashboard/src/app/nebula-app/(app)/api/chat.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,10 @@ export async function promptNebula(params: {
202202
break;
203203
}
204204

205+
case "ping": {
206+
break;
207+
}
208+
205209
default: {
206210
console.warn("unhandled event", event);
207211
}
@@ -298,4 +302,8 @@ type ChatStreamedEvent =
298302
| {
299303
event: "error";
300304
data: string;
305+
}
306+
| {
307+
event: "ping";
308+
data: string;
301309
};

0 commit comments

Comments
 (0)