Skip to content

fix: presentation download system message in chat export - #25404

Merged
antobinary merged 5 commits into
bigbluebutton:v4.0.x-developfrom
ramonlsouza:i-25387
Jul 21, 2026
Merged

antobinary merged 5 commits into
bigbluebutton:v4.0.x-developfrom
ramonlsouza:i-25387

Conversation

@ramonlsouza

Copy link
Copy Markdown
Member

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

  1. Join a meeting as presenter.
  2. Open Media Area -> Slides.
  3. On the current presentation, open the export dropdown (three-dots menu) and click Send out a download link for the presentation including whiteboard annotations.
  4. Wait for the annotated PDF to be generated. A "Presentation available for download" card appears in Public Chat with the filename and a download button.
  5. In the chat header, click ⋮ → Save.
  6. Open the downloaded .txt file.
  7. Check the line for the download-link message.

@coderabbitai

coderabbitai Bot commented Jul 10, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

Presentation download metadata handling is centralized in getPresentationDownloadData, which validates metadata and constructs an authenticated download URL. The presentation chat component uses the shared helper for rendering filenames and links. Chat export now formats presentation messages with a filename, handles deleted messages before type-specific processing, and decodes ordinary text content. The chat history query requests messageAsHtml, and the English locale adds the presentation download label.

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
Loading

Suggested reviewers: tainan404

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The PR appears to fix the deleted-message fallback, but it does not show exporting the presentation download URL or the other system message types in #25387. Add export handling for presentation metadata that includes the download URL, and cover PLUGIN, BREAKOUT_ROOM, and API messages via messageAsHtml.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly states the main change: fixing presentation download messages in chat export.
Description check ✅ Passed The description matches the changeset and describes the chat export fix for deleted and presentation messages.
Out of Scope Changes check ✅ Passed The changes shown are all related to chat export and presentation download message handling.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 win

Rename destructured variable string to metadata for clarity.

The destructuring pattern ({ metadata: string }) renames the metadata prop to a local variable named string — this is not a type annotation. Using string as a variable name in a .tsx file 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 win

Wrap getPresentationDownloadData in try/catch to prevent a single malformed message from failing the entire export.

getPresentationDownloadData can throw from JSON.parse or assertAsPresentationMetadata. Since this runs inside a reduce callback with no error handling, one malformed PRESENTATION message will crash generateExportedMessages and 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

📥 Commits

Reviewing files that changed from the base of the PR and between 3cbd010 and 9689bea.

📒 Files selected for processing (4)
  • bigbluebutton-html5/imports/ui/components/chat/chat-graphql/chat-header/chat-actions/services.ts
  • bigbluebutton-html5/imports/ui/components/chat/chat-graphql/chat-message-list/page/chat-message/message-content/presentation-content/component.tsx
  • bigbluebutton-html5/imports/ui/components/chat/chat-graphql/chat-message-list/page/chat-message/message-content/presentation-content/service.ts
  • bigbluebutton-html5/public/locales/en.json

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 getPresentationDownloadData helper.
  • 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.

@Tainan404

Copy link
Copy Markdown
Member

The user session token is leaked through the download link on chat export:

extracted-presentation-link-contains-session-token.webm

related to chat export:

the moderator request message is blank on export:

moderator-request-is-blank-on-export.webm

System messages markdown are stripped from system messages on export:

STRIPPED.MARKDOWN.webm

@sonarqubecloud

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

📥 Commits

Reviewing files that changed from the base of the PR and between 6afe3cf and 3c78bf9.

📒 Files selected for processing (2)
  • bigbluebutton-html5/imports/ui/components/chat/chat-graphql/chat-header/chat-actions/services.ts
  • bigbluebutton-html5/imports/ui/components/chat/chat-graphql/chat-message-list/page/chat-message/message-content/presentation-content/service.ts

@github-actions

Copy link
Copy Markdown

✅ Automated tests have passed!

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 metadata to a local variable named string, which is easy to misread as a type annotation and makes the call site (getPresentationDownloadData(string)) unnecessarily confusing. Use a normal metadata local variable instead.
const ChatMessagePresentationContent: React.FC<ChatMessagePresentationContentProps> = ({
  metadata: string,
}) => {
  const intl = useIntl();
  const { downloadUrl, filename } = getPresentationDownloadData(string);

Comment on lines +102 to +107
case ChatMessageType.PRESENTATION: {
const { filename } = parsePresentationMetadata(message.messageMetadata);
const presentationAvailable = intl.formatMessage(intlMessages.presentationAvailableForDownload);
messageText = `${presentationAvailable}: ${filename}`;
break;
}
@antobinary
antobinary merged commit a21b0cc into bigbluebutton:v4.0.x-develop Jul 21, 2026
37 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.

4 participants