Skip to content

fix: reintroduce meta_hack-record-viewer-video - #23366

Merged
antobinary merged 2 commits into
bigbluebutton:v3.0.x-releasefrom
prlanzarin:u30/fix/meta-hackrecviewer-fixup
Jun 11, 2025
Merged

antobinary merged 2 commits into
bigbluebutton:v3.0.x-releasefrom
prlanzarin:u30/fix/meta-hackrecviewer-fixup

Conversation

@prlanzarin

@prlanzarin prlanzarin commented Jun 11, 2025 •

Copy link
Copy Markdown
Member

What does this PR do?

  • fix: reintroduce meta_hack-record-viewer-video
    • Metadata support was removed from the client and
      meta_hack-record-viewer-video was removed alongside it. There are still
      some users of that metaparam, so it needs to be reintroduced.
    • Extend the GetRecordingStatus server-side probe made between webrtc-sfu
      and akka-apps so that it responds with media-specific recording consent
      states for audio, cameras and screen sharing. Audio and screen sharing
      are unimplemented right now (default to true), but cameras work as
      follows:
      • Factor meta_hack-record-viewer-video and userdata-bbb_record_video
        into the consent resolution for the requester
      • Respond with the appropriate consent state for cameras via the
        recordUserCameras field.
    • Actually handling of these consent booleans is done by bbb-webrtc-sfu.
  • build(bbb-webrtc-sfu): v2.19.0-beta.2
    • feat: add support for camera recording consent flag

Closes Issue(s)

None

@prlanzarin prlanzarin added this to the Release 3.0 milestone Jun 11, 2025
@coderabbitai

coderabbitai Bot commented Jun 11, 2025 •

Copy link
Copy Markdown
Contributor

Walkthrough

The changes introduce three new Boolean flags—recordUserAudio, recordUserCameras, and recordUserScreenShare—to the recording status response mechanism in the application. The method responsible for building the recording status response message was updated to accept these new parameters, and the corresponding case class for the response message body was extended to include them. Logic was added to determine the values of these flags based on user metadata, global meeting settings, and user roles. Additionally, a script was updated to clone a newer branch of a dependency, moving from v2.19.0-beta.1 to v2.19.0-beta.2.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant CoreApp as Core Application
    participant MsgBuilder as Message Builder

    User->>CoreApp: Request recording status
    CoreApp->>CoreApp: Determine recordUserAudio (hardcoded true)
    CoreApp->>CoreApp: Determine recordUserScreenShare (hardcoded true)
    CoreApp->>CoreApp: Lookup user metadata for bbb_record_video
    CoreApp->>CoreApp: Check global hack-record-viewer-video setting
    CoreApp->>CoreApp: Compute recordUserCameras based on role and settings
    CoreApp->>MsgBuilder: buildGetRecordingStatusRespMsg(..., recordUserAudio, recordUserCameras, recordUserScreenShare)
    MsgBuilder-->>CoreApp: GetRecordingStatusRespMsgBody with new flags
    CoreApp-->>User: Send updated recording status response
Loading
✨ 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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Metadata support was removed from the client and
meta_hack-record-viewer-video was removed alongside it. There are still
some users of that metaparam, so it needs to be reintroduced.

Extend the GetRecordingStatus server-side probe made between webrtc-sfu
and akka-apps so that it responds with media-specific recording consent
states for audio, cameras and screen sharing. Audio and screen sharing
are unimplemented right now (default to true), but cameras work as
follows:
  - Factor meta_hack-record-viewer-video and userdata-bbb_record_video
    into the consent resolution for the requester
  - Respond with the appropriate consent state for cameras via the
    recordUserCameras field.
Actually handling of these consent booleans is done by bbb-webrtc-sfu.
@prlanzarin
prlanzarin force-pushed the u30/fix/meta-hackrecviewer-fixup branch from c6c71d2 to cf8523f Compare June 11, 2025 14:18
v2.19.0-beta.2
---
* feat: add support for camera recording consent flag
@prlanzarin
prlanzarin marked this pull request as ready for review June 11, 2025 14:45
@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

🧹 Nitpick comments (2)
akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/GetRecordingStatusReqMsgHdlr.scala (2)

38-45: Complete the implementation for audio and screenshare recording consents.

The comment indicates these features are not fully implemented, but they're hardcoded to true. This could lead to unexpected behavior if clients rely on these flags.

Would you like me to help implement the proper logic for recordUserAudio and recordUserScreenShare based on user metadata, similar to how recordUserCameras is handled? I can open a new issue to track this task.


47-67: Consider refactoring for improved readability and maintainability.

The logic for determining camera recording consent is complex with nested conditions. Also, the metadata key "hack-record-viewer-video" suggests this might be a temporary solution.

Consider extracting the logic into a separate method for better readability:

-val userOption = Users2x.findWithIntId(liveMeeting.users2x, msg.header.userId)
-val recordVideoFromUserMetadata: Boolean = userOption
-  .flatMap(_.userMetadata.get("bbb_record_video"))
-  .map(_.toBoolean)
-  .getOrElse(true)
-
-val globalRecordViewerVideoSetting: Boolean = liveMeeting.props.metadataProp.metadata
-  .get("hack-record-viewer-video")
-  .map(_.toBoolean)
-  .getOrElse(true)
-val recordViewerVideoFromUserMetadata: Boolean = userOption.map { user =>
-  // Moderators always have recording permission unless explicitly disabled via userdata
-  if (user.role == Roles.MODERATOR_ROLE) {
-    true
-  } else {
-    // For non-moderators, use globalRecordViewerVideoSetting
-    globalRecordViewerVideoSetting
-  }
-}.getOrElse(true)
-
-val recordUserCameras = recordVideoFromUserMetadata && recordViewerVideoFromUserMetadata
+val recordUserCameras = calculateCameraRecordingConsent(
+  Users2x.findWithIntId(liveMeeting.users2x, msg.header.userId),
+  liveMeeting.props.metadataProp.metadata
+)

Add this private method to the trait:

private def calculateCameraRecordingConsent(
    userOption: Option[User2x],
    meetingMetadata: Map[String, String]
): Boolean = {
  val userRecordVideoConsent = userOption
    .flatMap(_.userMetadata.get("bbb_record_video"))
    .map(_.toBoolean)
    .getOrElse(true)
    
  val globalViewerVideoSetting = meetingMetadata
    .get("hack-record-viewer-video")
    .map(_.toBoolean)
    .getOrElse(true)
    
  val viewerRecordConsent = userOption.map { user =>
    user.role == Roles.MODERATOR_ROLE || globalViewerVideoSetting
  }.getOrElse(true)
  
  userRecordVideoConsent && viewerRecordConsent
}

Also, is the metadata key "hack-record-viewer-video" intended to be permanent? The "hack" prefix suggests it's temporary.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d8194ca and f490399.

📒 Files selected for processing (3)
  • akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/GetRecordingStatusReqMsgHdlr.scala (2 hunks)
  • bbb-common-message/src/main/scala/org/bigbluebutton/common2/msgs/UsersMsgs.scala (1 hunks)
  • bbb-webrtc-sfu.placeholder.sh (1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/GetRecordingStatusReqMsgHdlr.scala (1)
bbb-common-message/src/main/scala/org/bigbluebutton/common2/msgs/UsersMsgs.scala (3)
  • GetRecordingStatusRespMsg (127-127)
  • GetRecordingStatusRespMsg (128-128)
  • GetRecordingStatusRespMsgBody (129-137)
⏰ Context from checks skipped due to timeout of 90000ms (6)
  • GitHub Check: build-package (bbb-playback-record)
  • GitHub Check: build-package (bbb-webrtc)
  • GitHub Check: build-package (bbb-fsesl-akka)
  • GitHub Check: build-package (others)
  • GitHub Check: build-package (bbb-freeswitch)
  • GitHub Check: build-package (bbb-graphql-server)
🔇 Additional comments (2)
bbb-common-message/src/main/scala/org/bigbluebutton/common2/msgs/UsersMsgs.scala (1)

129-137:

Details

❓ Verification inconclusive

API extension looks good, but verify backward compatibility.

The addition of the three new Boolean fields follows the existing naming convention and structure. However, this change breaks binary compatibility of the message format.

Run the following script to check if any external components or services consume this message type and might be affected by the API change:


🏁 Script executed:

#!/bin/bash
# Description: Search for consumers of GetRecordingStatusRespMsg to assess impact

# Look for direct usage of the message type
rg -A 5 "GetRecordingStatusRespMsg" --type scala --type java

# Look for pattern matching or field access on GetRecordingStatusRespMsgBody
ast-grep --pattern 'GetRecordingStatusRespMsgBody($$$)'

# Check for JSON serialization/deserialization of this message
rg -A 3 "GetRecordingStatusRespMsgBody.*Json|Json.*GetRecordingStatusRespMsgBody"

Length of output: 5320


Binary compatibility risk: newly added fields in GetRecordingStatusRespMsgBody

The addition of recordUserAudio, recordUserCameras, and recordUserScreenShare at the end of the case class preserves source compatibility but breaks binary compatibility. Our quick search shows only internal construction of this message in:

  • bbb-common-message/src/main/scala/org/bigbluebutton/common2/msgs/UsersMsgs.scala (new fields)
  • akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/GetRecordingStatusReqMsgHdlr.scala (updated constructor)

We didn’t find any JSON serialization formats in this repo, so please manually verify:

  • Any JSON (de)serializers or format implicits for GetRecordingStatusRespMsgBody are updated to include the new fields.
  • Downstream consumers (e.g., web clients, external services) can handle these added Booleans—consider providing defaults if needed.
bbb-webrtc-sfu.placeholder.sh (1)

3-3:

Details

✅ Verification successful

Version update aligns with PR objectives.

The update to v2.19.0-beta.2 is consistent with the PR description stating that bbb-webrtc-sfu adds support for the camera recording consent flag.

Verify that this tag exists and contains the expected camera recording consent support:


🏁 Script executed:

#!/bin/bash
# Description: Verify the bbb-webrtc-sfu version tag exists and check release notes

# Check if the tag exists
git ls-remote --tags https://github.com/bigbluebutton/bbb-webrtc-sfu | grep "v2.19.0-beta.2"

# Get information about what changed between beta.1 and beta.2
curl -s https://api.github.com/repos/bigbluebutton/bbb-webrtc-sfu/compare/v2.19.0-beta.1...v2.19.0-beta.2 | jq -r '.commits[].commit.message' 2>/dev/null || echo "Failed to fetch comparison"

Length of output: 437


Approved: v2.19.0-beta.2 bump includes camera recording consent support

  • Verified that tag v2.19.0-beta.2 exists in the bbb-webrtc-sfu repo.
  • Confirmed commit message “feat: add support for camera recording consent flag” is included.

No further changes required.

@github-actions

Copy link
Copy Markdown

Automated tests Summary

✅ All the CI tests have passed!

@antobinary antobinary left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Tested, worked well for me!

@antobinary
antobinary merged commit cfb3fcb into bigbluebutton:v3.0.x-release Jun 11, 2025
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.

2 participants