Skip to content

Fix: Chat streaming, error handling, and emoji rendering#2

Merged
weronikakolodziej merged 1 commit into
mainfrom
unicode-fix
Jul 14, 2026
Merged

Fix: Chat streaming, error handling, and emoji rendering#2
weronikakolodziej merged 1 commit into
mainfrom
unicode-fix

Conversation

@weronikakolodziej

Copy link
Copy Markdown
Collaborator
  1. ChatInterface.tsx — Fixed [object Object] in chat responses
    The RavenDB AI Agent streams responses as a series of Reply { answer, followups } objects rather than raw strings. The previous code used botText += JSON.parse(chunk), which resulted in "[object Object]" due to JavaScript's standard toString() behavior on objects. Since each incoming chunk already contains the fully accumulated response text up to that moment, the fix replaces botText directly with parsed.answer instead of appending the entire object.

  2. api.ts — Fixed stuck loading state on backend errors
    When an exception occurs, the backend sends an SSE event: error (containing a ChatResponse with the error message) and then closes the stream. The previous code only handled event: final, meaning the error event fell through to onChunk. As a result, the Promise never resolved, leaving the application permanently stuck in a loading state with the input disabled.

The fix treats event: error exactly like event: final: it aborts the connection (ctrl.abort()) and resolves the Promise with the response. This ensures backend errors are properly displayed as chat messages, allowing the user to continue typing.

  1. index.css — Fixed emojis rendering as ◆
    The font stack lacked dedicated emoji fonts, preventing the browser from properly rendering emojis in the AI's responses and causing them to display as black diamonds (◆). Added 'Segoe UI Emoji', 'Segoe UI Symbol', 'Apple Color Emoji', and 'Noto Color Emoji' directly after 'Segoe UI' to ensure a proper fallback across all major platforms (Windows, macOS, and Linux).

@weronikakolodziej
weronikakolodziej merged commit f2c7d32 into main Jul 14, 2026
7 checks passed
@weronikakolodziej
weronikakolodziej deleted the unicode-fix branch July 14, 2026 11:22
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.

3 participants