Repository navigation
fix: presentation download system message in chat export - #25404
Conversation
WalkthroughPresentation download metadata handling is centralized in Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant ChatExport
participant PresentationDataService
participant MeetingSettings
participant ExportLocale
ChatExport->>PresentationDataService: parse presentation metadata
PresentationDataService->>MeetingSettings: read BBB web base URL
MeetingSettings-->>PresentationDataService: return configured base URL
PresentationDataService-->>ChatExport: return filename and authenticated download URL
ChatExport->>ExportLocale: format presentation availability label
ExportLocale-->>ChatExport: return localized label
Suggested reviewers: 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (2)
bigbluebutton-html5/imports/ui/components/chat/chat-graphql/chat-message-list/page/chat-message/message-content/presentation-content/component.tsx (1)
21-25: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winRename destructured variable
stringtometadatafor clarity.The destructuring pattern
({ metadata: string })renames themetadataprop to a local variable namedstring— this is not a type annotation. Usingstringas a variable name in a.tsxfile is confusing and looks like a type annotation at first glance.♻️ Proposed refactor
const ChatMessagePresentationContent: React.FC<ChatMessagePresentationContentProps> = ({ - metadata: string, + metadata, }) => { const intl = useIntl(); - const { downloadUrl, filename } = getPresentationDownloadData(string); + const { downloadUrl, filename } = getPresentationDownloadData(metadata);🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@bigbluebutton-html5/imports/ui/components/chat/chat-graphql/chat-message-list/page/chat-message/message-content/presentation-content/component.tsx` around lines 21 - 25, Rename the destructured prop alias in ChatMessagePresentationContent from string to metadata, then update the getPresentationDownloadData call to use metadata.bigbluebutton-html5/imports/ui/components/chat/chat-graphql/chat-header/chat-actions/services.ts (1)
98-103: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick winWrap
getPresentationDownloadDatain try/catch to prevent a single malformed message from failing the entire export.
getPresentationDownloadDatacan throw fromJSON.parseorassertAsPresentationMetadata. Since this runs inside areducecallback with no error handling, one malformedPRESENTATIONmessage will crashgenerateExportedMessagesand produce no export at all.🔒️ Proposed fix — graceful fallback on parse failure
case ChatMessageType.PRESENTATION: { - const { absoluteDownloadUrl, filename } = getPresentationDownloadData(message.messageMetadata); - const presentationAvailable = intl.formatMessage(intlMessages.presentationAvailableForDownload); - messageText = `${presentationAvailable}: ${filename} - ${absoluteDownloadUrl}`; + try { + const { absoluteDownloadUrl, filename } = getPresentationDownloadData(message.messageMetadata); + const presentationAvailable = intl.formatMessage(intlMessages.presentationAvailableForDownload); + messageText = `${presentationAvailable}: ${filename} - ${absoluteDownloadUrl}`; + } catch { + messageText = htmlDecode(message.message || ''); + } break; }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@bigbluebutton-html5/imports/ui/components/chat/chat-graphql/chat-header/chat-actions/services.ts` around lines 98 - 103, Wrap the getPresentationDownloadData call in the PRESENTATION branch of the reduce callback with try/catch so malformed metadata cannot abort generateExportedMessages. Preserve the existing formatted download text on success, and provide a safe fallback message when parsing or validation throws.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@bigbluebutton-html5/imports/ui/components/chat/chat-graphql/chat-message-list/page/chat-message/message-content/presentation-content/component.tsx`:
- Around line 26-31: Update parseFilename to join the filename segments with '.'
rather than an empty string after removing the extension, preserving dots in
multi-dot filenames such as “my.presentation.pdf”.
---
Nitpick comments:
In
`@bigbluebutton-html5/imports/ui/components/chat/chat-graphql/chat-header/chat-actions/services.ts`:
- Around line 98-103: Wrap the getPresentationDownloadData call in the
PRESENTATION branch of the reduce callback with try/catch so malformed metadata
cannot abort generateExportedMessages. Preserve the existing formatted download
text on success, and provide a safe fallback message when parsing or validation
throws.
In
`@bigbluebutton-html5/imports/ui/components/chat/chat-graphql/chat-message-list/page/chat-message/message-content/presentation-content/component.tsx`:
- Around line 21-25: Rename the destructured prop alias in
ChatMessagePresentationContent from string to metadata, then update the
getPresentationDownloadData call to use metadata.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 36877cf4-7a1b-4d6e-9a70-12da85ae4ca3
📒 Files selected for processing (4)
bigbluebutton-html5/imports/ui/components/chat/chat-graphql/chat-header/chat-actions/services.tsbigbluebutton-html5/imports/ui/components/chat/chat-graphql/chat-message-list/page/chat-message/message-content/presentation-content/component.tsxbigbluebutton-html5/imports/ui/components/chat/chat-graphql/chat-message-list/page/chat-message/message-content/presentation-content/service.tsbigbluebutton-html5/public/locales/en.json
There was a problem hiding this comment.
Pull request overview
This PR fixes BigBlueButton’s “Save Chat” export so system messages related to presentation-download links are exported as meaningful plain text (instead of incorrectly appearing as deleted), and refactors presentation-download parsing into a reusable helper.
Changes:
- Add explicit export handling for
ChatMessageType.PRESENTATION, formatting filename + authenticated download URL for chat transcript output. - Refactor presentation-download metadata parsing/URL generation into a shared
getPresentationDownloadDatahelper. - Add a new i18n string used as the exported-chat prefix for presentation download messages.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| bigbluebutton-html5/public/locales/en.json | Adds the “Presentation available for download” export label string. |
| bigbluebutton-html5/imports/ui/components/chat/chat-graphql/chat-message-list/page/chat-message/message-content/presentation-content/service.ts | New helper to parse presentation metadata and build authenticated/absolute download URLs. |
| bigbluebutton-html5/imports/ui/components/chat/chat-graphql/chat-message-list/page/chat-message/message-content/presentation-content/component.tsx | Uses the new helper for rendering presentation download cards. |
| bigbluebutton-html5/imports/ui/components/chat/chat-graphql/chat-header/chat-actions/services.ts | Updates chat export generation to handle deleted/system/presentation messages and format presentation download exports. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
The user session token is leaked through the download link on chat export: extracted-presentation-link-contains-session-token.webmrelated to chat export: the moderator request message is blank on export: moderator-request-is-blank-on-export.webmSystem messages markdown are stripped from system messages on export: STRIPPED.MARKDOWN.webm |
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@bigbluebutton-html5/imports/ui/components/chat/chat-graphql/chat-header/chat-actions/services.ts`:
- Around line 102-107: Update the ChatMessageType.PRESENTATION branch in the
message-text reduction to wrap parsePresentationMetadata in try/catch,
preventing malformed metadata from aborting the entire chat export. On parsing
failure, follow the existing BREAKOUT_CALL_MODERATOR defensive fallback pattern
and continue processing subsequent messages.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 37f28ebe-916c-4310-a2bb-dfad40ae5823
📒 Files selected for processing (2)
bigbluebutton-html5/imports/ui/components/chat/chat-graphql/chat-header/chat-actions/services.tsbigbluebutton-html5/imports/ui/components/chat/chat-graphql/chat-message-list/page/chat-message/message-content/presentation-content/service.ts
✅ Automated tests have passed! |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
bigbluebutton-html5/imports/ui/components/chat/chat-graphql/chat-message-list/page/chat-message/message-content/presentation-content/component.tsx:25
- The prop destructuring renames
metadatato a local variable namedstring, which is easy to misread as a type annotation and makes the call site (getPresentationDownloadData(string)) unnecessarily confusing. Use a normalmetadatalocal variable instead.
const ChatMessagePresentationContent: React.FC<ChatMessagePresentationContentProps> = ({
metadata: string,
}) => {
const intl = useIntl();
const { downloadUrl, filename } = getPresentationDownloadData(string);
| case ChatMessageType.PRESENTATION: { | ||
| const { filename } = parsePresentationMetadata(message.messageMetadata); | ||
| const presentationAvailable = intl.formatMessage(intlMessages.presentationAvailableForDownload); | ||
| messageText = `${presentationAvailable}: ${filename}`; | ||
| break; | ||
| } |



What does this PR do?
Updates chat export to correctly handle deleted messages and exported slides messages.
Closes Issue(s)
Closes #25387
How to test
.txtfile.