Skip to content

fix (html5): Show chat message notification from html version of the message (instead of markdown)#24421

Merged
antobinary merged 1 commit intobigbluebutton:v3.0.x-releasefrom
gustavotrott:chat-msg-stream-messageAsHtml
Jan 8, 2026
Merged

fix (html5): Show chat message notification from html version of the message (instead of markdown)#24421
antobinary merged 1 commit intobigbluebutton:v3.0.x-releasefrom
gustavotrott:chat-msg-stream-messageAsHtml

Conversation

@gustavotrott
Copy link
Collaborator

Currently, chat message notifications display the raw Markdown syntax.
It should instead use the HTML version of the message, which appears correctly without the markdown characters.

Before: notification-before After: notification-after

@gustavotrott gustavotrott added this to the Release 3.0 milestone Jan 7, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 7, 2026

Walkthrough

This change adds support for rendering pre-formatted HTML content in chat messages. The backend service now extracts the messageAsHtml field from message properties and includes it in the GraphQL message payload. The GraphQL schema is updated to define messageAsHtml as a string field in the Message interface and includes it in the CHAT_MESSAGE_STREAM subscription. The frontend component is updated to render the message using msg.messageAsHtml instead of the raw msg.message field.

Sequence Diagram

sequenceDiagram
    participant Source as Message<br/>Source
    participant Backend as chatMessageStream<br/>(Go)
    participant GraphQL as GraphQL<br/>Subscription
    participant Frontend as Alert<br/>Component
    
    Source->>Backend: Message with messageProps
    activate Backend
    Backend->>Backend: Extract messageAsHtml<br/>from messageProps
    Backend->>Backend: Build GraphQL payload<br/>with messageAsHtml
    deactivate Backend
    
    Backend->>GraphQL: Stream message item<br/>(includes messageAsHtml)
    activate GraphQL
    GraphQL->>GraphQL: Resolve Message type<br/>with messageAsHtml field
    deactivate GraphQL
    
    GraphQL->>Frontend: CHAT_MESSAGE_STREAM<br/>subscription data
    activate Frontend
    Frontend->>Frontend: mapTextContent()<br/>uses msg.messageAsHtml
    Frontend->>Frontend: Strip HTML tags &<br/>unescape for display
    deactivate Frontend
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: switching chat message notifications from displaying raw markdown to displaying the HTML version of messages.
Description check ✅ Passed The description clearly explains the problem (notifications showing raw Markdown syntax) and the solution (using the HTML version), supported by before/after screenshots demonstrating the improvement.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Jan 7, 2026

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In @bbb-graphql-middleware/internal/streaming_server/chatMessageStream.go:
- Line 55: The code uses an unsafe type assertion
messageProps["messageAsHtml"].(string) which can panic if the key is missing or
not a string; update the access in chatMessageStream.go to use the safe
two-value form (v, ok := messageProps["messageAsHtml"]; s, okStr := v.(string))
and provide a sensible default (e.g., empty string) when ok or okStr is false so
messageAsHtml is always a string and no runtime panic occurs.

In
@bigbluebutton-html5/imports/ui/components/chat/chat-graphql/alert/component.tsx:
- Line 132: The code uses msg.messageAsHtml with stripTags and unescapeHtml
which will throw if messageAsHtml is null/undefined; update the expression at
the return site to defensively fallback (e.g., use msg.messageAsHtml || '')
before passing to stripTags/unescapeHtml so it matches patterns elsewhere (see
msg.messageAsHtml, stripTags, unescapeHtml) and prevents runtime errors when the
backend omits or nulls that field.
📜 Review details

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 53a7576 and 4eb00f1.

📒 Files selected for processing (3)
  • bbb-graphql-middleware/internal/streaming_server/chatMessageStream.go
  • bigbluebutton-html5/imports/ui/components/chat/chat-graphql/alert/component.tsx
  • bigbluebutton-html5/imports/ui/components/chat/chat-graphql/alert/queries.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: build-package (bbb-html5)
  • GitHub Check: build-package (bbb-graphql-server)
🔇 Additional comments (3)
bbb-graphql-middleware/internal/streaming_server/chatMessageStream.go (1)

72-72: Field correctly added to GraphQL payload.

The messageAsHtml field is properly included in the item map and will be available to GraphQL subscribers.

bigbluebutton-html5/imports/ui/components/chat/chat-graphql/alert/queries.ts (2)

7-7: Interface correctly extended with messageAsHtml field.

The messageAsHtml field is properly typed as a string and maintains backward compatibility by keeping the original message field.


30-30: GraphQL subscription correctly updated to fetch messageAsHtml.

The subscription now includes messageAsHtml in the selection set, enabling clients to receive the HTML-rendered message content.

@github-actions
Copy link

github-actions bot commented Jan 7, 2026

Automated tests Summary

All the CI tests have passed!

@gustavotrott gustavotrott requested review from Tainan404 and removed request for JoVictorNunes January 7, 2026 17:15
@antobinary antobinary merged commit 9be03ca into bigbluebutton:v3.0.x-release Jan 8, 2026
34 checks passed
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