-
Notifications
You must be signed in to change notification settings - Fork 618
[Nebula] Remove presence message when adding an error message #5711
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Nebula] Remove presence message when adding an error message #5711
Conversation
|
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #5711 +/- ##
=======================================
Coverage 51.53% 51.53%
=======================================
Files 1094 1094
Lines 57592 57592
Branches 4755 4755
=======================================
Hits 29681 29681
Misses 27193 27193
Partials 718 718
*This pull request uses carry forward flags. Click here to find out more. |
size-limit report 📦
|
apps/dashboard/src/app/nebula-app/(app)/components/ChatPageContent.tsx
Outdated
Show resolved
Hide resolved
d8ae044 to
611ed23
Compare
7416a7b to
9fbd0f0
Compare
9fbd0f0 to
6f04b6e
Compare
6f04b6e to
2cb3c48
Compare
| // add error message | ||
| newMessages.push({ | ||
| text: `Error: ${error instanceof Error ? error.message : "Failed to execute command"}`, | ||
| type: "error", | ||
| }, | ||
| ]); | ||
| }); | ||
|
|
||
| return newMessages; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
still would prefer to not mutate the array with push and instead do [...newMessages, {}] but it's a nitpick at this point so ship it
Merge activity
|
Fixes: DASH-614 <!-- start pr-codex --> --- ## PR-Codex overview This PR focuses on improving error handling in the `setMessages` function within the `ChatPageContent` component. It modifies how error messages are added to the message list, ensuring that the previous messages are preserved correctly. ### Detailed summary - Refactored `setMessages` to create a new array `newMessages` based on previous messages. - Added a condition to exclude the last message if its type is "presence". - Pushed a new error message object containing the error details to `newMessages`. - Returned `newMessages` from `setMessages`. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex -->
2cb3c48 to
0842045
Compare

Fixes: DASH-614
PR-Codex overview
This PR focuses on improving error handling in the
setMessagesfunction within theChatPageContentcomponent. It modifies how error messages are constructed and added to the message list.Detailed summary
setMessagesto create a new arraynewMessages.sliceto conditionally exclude the last message if its type ispresence.newMessageswith a clear error description.newMessagesinstead of directly updating the state.