Skip to content

Port BBB 3.0.24 to the upcoming BBB 3.0.25+ - #24906

Merged
antobinary merged 3 commits into
bigbluebutton:v3.0.x-developfrom
antobinary:backport3024
Apr 13, 2026
Merged

antobinary merged 3 commits into
bigbluebutton:v3.0.x-developfrom
antobinary:backport3024

Conversation

@antobinary

Copy link
Copy Markdown
Member

antobinary and others added 3 commits April 13, 2026 14:26
* Add auth check for caption updates

* Verify user ID on caption submission

* Ignore logoutURL param on checksum failure

---------

Co-authored-by: Paul Trudel <[email protected]>
@antobinary antobinary added this to the Release 3.0 milestone Apr 13, 2026
@coderabbitai

coderabbitai Bot commented Apr 13, 2026 •

Copy link
Copy Markdown
Contributor

Walkthrough

This pull request introduces additional authorization and validation controls throughout the caption submission pipeline. Changes span multiple layers: client-side moderator checks in the GraphQL action, permission and caption-type validation in the Scala application handler, user state validation (listenOnly check) during transcript updates, and database-level conflict resolution tied to userId. The web layer adjusts logout URL handling for checksum-related join errors. Together, these changes restrict caption submission to authorized, non-listenOnly users and enforce caption-type allowlisting.

Sequence Diagram(s)

sequenceDiagram
    participant Client as GraphQL Client
    participant GraphQL as captionSubmitTranscript
    participant ApiCtrl as ApiController
    participant CaptionApp as CaptionApp2x
    participant VoiceUsers as liveMeeting<br/>voiceUsers
    participant CaptionDAO as CaptionDAO
    participant DB as PostgreSQL

    Client->>GraphQL: submitCaption(input)
    GraphQL->>GraphQL: throwErrorIfNotModerator()
    alt Moderator check fails
        GraphQL-->>Client: Error
    else Moderator check passes
        GraphQL->>GraphQL: throwErrorIfInvalidInput()
        alt Input invalid
            GraphQL-->>Client: Error
        else Input valid
            GraphQL->>CaptionApp: CaptionSubmitTranscriptPubMsg
            CaptionApp->>CaptionApp: permissionFailed(MOD_LEVEL, VIEWER_LEVEL)
            alt Permission check fails
                CaptionApp-->>Client: Error
            else Permission check passes
                CaptionApp->>CaptionApp: Validate captionType<br/>(allowlist: TYPED, AUDIO_TRANSCRIPTION)
                alt Caption type invalid
                    CaptionApp->>CaptionApp: Log warning
                    CaptionApp-->>Client: Skip persistence & broadcast
                else Caption type valid
                    CaptionApp->>VoiceUsers: Fetch user
                    alt User is listenOnly
                        CaptionApp-->>Client: Skip update
                    else User not listenOnly
                        CaptionApp->>CaptionDAO: insertOrUpdateCaption()
                        CaptionDAO->>DB: INSERT ... ON CONFLICT<br/>WHERE userId matches
                        DB-->>CaptionDAO: Upsert result
                        CaptionApp->>Client: broadcastSuccessEvent()
                    end
                end
            end
        end
    end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~50 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%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Port BBB 3.0.24 to the upcoming BBB 3.0.25+' accurately reflects the PR's purpose of porting changes from version 3.0.24 into the development branch, which is directly supported by the PR objectives and commit messages.
Description check ✅ Passed The description provides a link to the v3.0.24 release notes, which directly relates to the PR's objective of porting that release into the v3.0.x-develop branch, though it lacks detail.

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

✨ 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 and usage tips.

@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 the current code and only fix it if needed.

Inline comments:
In `@akka-bbb-apps/src/main/scala/org/bigbluebutton/core/db/CaptionDAO.scala`:
- Around line 37-45: The upsert in CaptionDAO.scala silently no-ops when the
WHERE "caption"."userId" = ${userId} rejects a conflicting row; change the DAO
method performing this sqlu upsert to return the affected-row count or a boolean
(e.g., rowsAffected: Int or success: Boolean) and detect ownership mismatch
(rowsAffected == 0) and either return false or throw a specific
OwnershipMismatchException; then update the callers CaptionApp2x.handle and
UpdateTranscriptPubMsgHdlr.handle to check the DAO result and only broadcast
success when the write succeeded (or propagate the exception to fail-fast) so
clients don’t get false positives.
🪄 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: 7a33706c-4e05-445c-884d-390b62459f70

📥 Commits

Reviewing files that changed from the base of the PR and between 518e689 and aaf5aac.

📒 Files selected for processing (5)
  • akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/audiocaptions/UpdateTranscriptPubMsgHdlr.scala
  • akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/caption/CaptionApp2x.scala
  • akka-bbb-apps/src/main/scala/org/bigbluebutton/core/db/CaptionDAO.scala
  • bbb-graphql-actions/src/actions/captionSubmitTranscript.ts
  • bigbluebutton-web/grails-app/controllers/org/bigbluebutton/web/controllers/ApiController.groovy

Comment on lines +37 to +45
sqlu"""INSERT INTO "caption" ("captionId", "meetingId", "captionType", "userId", "locale", "captionText", "createdAt")
VALUES (${captionId}, ${meetingId}, ${captionType}, ${userId}, ${locale}, ${transcript}, ${now})
ON CONFLICT ("captionId")
DO UPDATE SET
"captionText" = ${transcript},
"locale" = ${locale},
"captionType" = ${captionType},
"createdAt" = ${now}
WHERE "caption"."userId" = ${userId}"""

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.

⚠️ Potential issue | 🟠 Major

Surface ownership conflicts back to callers.

When the WHERE "caption"."userId" = ${userId} clause rejects the conflicting row, this upsert becomes a silent no-op. The current callers in CaptionApp2x.handle and UpdateTranscriptPubMsgHdlr.handle still broadcast success immediately afterwards, so meeting state can diverge from the database and clients get a false positive. Please return the affected-row count/boolean here (or fail fast on ownership mismatch) so the success path can be gated on an actual write.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@akka-bbb-apps/src/main/scala/org/bigbluebutton/core/db/CaptionDAO.scala`
around lines 37 - 45, The upsert in CaptionDAO.scala silently no-ops when the
WHERE "caption"."userId" = ${userId} rejects a conflicting row; change the DAO
method performing this sqlu upsert to return the affected-row count or a boolean
(e.g., rowsAffected: Int or success: Boolean) and detect ownership mismatch
(rowsAffected == 0) and either return false or throw a specific
OwnershipMismatchException; then update the callers CaptionApp2x.handle and
UpdateTranscriptPubMsgHdlr.handle to check the DAO result and only broadcast
success when the write succeeded (or propagate the exception to fail-fast) so
clients don’t get false positives.

@github-actions

Copy link
Copy Markdown

🚨 Automated tests failed

@antobinary
antobinary merged commit 5ab783e into bigbluebutton:v3.0.x-develop Apr 13, 2026
25 of 33 checks passed
@antobinary
antobinary deleted the backport3024 branch April 13, 2026 23:39
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.

1 participant