Skip to content

[3.0 backport] fix: Upload error toast for a rejected presentation can't be dismissed and keeps reappearing - #25916

Merged
antobinary merged 4 commits into
bigbluebutton:v3.0.x-developfrom
antobinary:fix-presentation-upload-error-toast-30
Oct 1, 2026
Merged

antobinary merged 4 commits into
bigbluebutton:v3.0.x-developfrom
antobinary:fix-presentation-upload-error-toast-30

Conversation

@antobinary

Copy link
Copy Markdown
Member

Backport of #25837 to v3.0.x-develop (fixes #25817 on 3.0), plus one prerequisite from #25272.

Commits

All four are clean cherry-picks; the resulting files are identical to 4.0.

Why the extra commit

With the guard removed, akka-apps emits RemovePresentationEvtMsg for a presentation that never converted. On 3.0 LearningDashboardActor.handleRemovePresentationEvtMsg then calls presentationSlides.last on an empty list and throws; the actor restarts with empty state and learning-dashboard data stops updating for every running meeting. 4.0 already has c6472f9, which guards this.

Testing (3.0)

Live A/B in a 3.0 container with akka-apps built from v3.0.x-develop (baseline) and from this branch. Rejected upload produced with maxNumPages=15 and a 16-page PDF. One run per cell.

Scenario Baseline This branch
Error toast does not reappear after closing it (viewer joins, starts webcam, next slide) FAIL PASS
"Clear errors" deletes the rejected presentation FAIL PASS
Presenter of meeting A cannot notify/remove a presentation of meeting B PASS PASS
Removing a rejected presentation in a meeting that never showed a slide: no akka exception, learning dashboard keeps updating PASS PASS

The last scenario FAILs (NoSuchElementException: empty.tail) with the three #25837 commits alone, which is why c6472f9 is included.

PresentationPodsAppSpec passes 6 of 6 when run in isolation; the 3.0 akka-apps test tree does not compile as a whole (unrelated files).

Not tested: other rejection types (mime type, size, conversion failure) and recorded meetings.

germanocaumo and others added 4 commits October 1, 2026 14:23
The learning dashboard actor could crash when stop/leave/end events arrived
without the corresponding in-memory activity item. For example, a webcam stop
event could call `.last` on an empty webcam vector, throwing
NoSuchElementException and restarting the actor. Since the actor keeps meeting
dashboard data in memory, that restart caused active meetings to stop receiving
dashboard updates.

Guard learning dashboard message handling and report sending with NonFatal
logging so one bad event or report failure does not restart the actor. Replace
unsafe `.last`, `.init`, and `dropRight(1)` updates with `lastOption`-based
handling and small helper methods for user session state transitions.

Also refactor the touched logic for readability:
- add helpers for open/flagged sessions and closing/reopening sessions
- use explicit matches for presentation, away, webcam, and screenshare state
- split user rejoin handling into named intermediate values
- use `meetings.values.foreach(sendReportSafely)` for periodic reports

Normal event behavior is preserved; the intentional behavior change is that
missing or already-closed activity state now no-ops safely and logs failures
instead of crashing the actor.

(cherry picked from commit c6472f9)
(cherry picked from commit 73ecbc1)
(cherry picked from commit 8905100)
@antobinary antobinary added this to the Release 3.0 milestone Oct 1, 2026
@antobinary
antobinary requested a review from ramonlsouza October 1, 2026 19:59
@coderabbitai

coderabbitai Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 8e836f05-4344-4588-ac3c-3a095a37648c

📥 Commits

Reviewing files that changed from the base of the PR and between 471fe86 and 2ae5b9c.

📒 Files selected for processing (5)
  • akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/PresentationPodsApp.scala
  • akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/RemovePresentationPubMsgHdlr.scala
  • akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/SetPresentationRenderedInToastPubMsgHdlr.scala
  • akka-bbb-apps/src/main/scala/org/bigbluebutton/endpoint/redis/LearningDashboardActor.scala
  • akka-bbb-apps/src/test/scala/org/bigbluebutton/core/apps/presentationpod/PresentationPodsAppSpec.scala
💤 Files with no reviewable changes (3)
  • akka-bbb-apps/src/test/scala/org/bigbluebutton/core/apps/presentationpod/PresentationPodsAppSpec.scala
  • akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/PresentationPodsApp.scala
  • akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/RemovePresentationPubMsgHdlr.scala

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.


Walkthrough

The presentation handlers no longer require a presentation to appear in the meeting’s pod state before processing removal or upload-completion notification. The learning dashboard actor now handles empty slide and session histories, updates user sessions through shared helpers, checks active items before stop updates, and catches non-fatal exceptions during message handling and report delivery.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Bug fix · Severity of issue fixed: Medium

Merge Risk: 🔵 Low · up to 2ae5b

The change makes the dashboard more resilient and fixes the rejected-upload toast. Behavior of the session handling changes is only lightly covered by automated tests, so the owner should be aware of that gap and watch dashboard behavior after merge.

Security Architecture Review

Security architecture risk: 🟡 Moderate · up to 2ae5b

A removal request can now delete a presentation’s stored metadata while leaving its live state in another presentation container. This creates a consistency risk within a meeting. The inspected database operations remain meeting-scoped, and the other changes improve failure containment.

Retained concerns

  • Medium · architecture · inferred: Removal no longer requires the requested presentation to belong to the requested pod. If a request reaches the handler with an existing pod A and a presentation held in pod B of the same meeting, the DAO can delete B’s persisted metadata while the event and live-state update target A, leaving B’s presentation in memory. Base rejected that pair. Meeting-scoped SQL prevents cross-meeting deletion but does not preserve this pod-to-presentation ownership invariant. Deployed exposure to multiple populated pods remains unverified.
Security review details

Security Blast Radius

  • observed — The inspected metadata update and deletion match the live meeting identifier as well as the presentation identifier. Supplying a presentation identifier belonging only to another meeting does not match its database row. The identified ownership-consistency concern is therefore meeting-local at these sinks.

Security Findings and Attack Paths

  • inferred — A caller able to reach removal with independently selected pod and presentation identifiers can trigger the ownership mismatch when both refer to different populated pods in the same meeting. The handler and model support this outcome, but upstream authorization and deployed multi-pod reachability were not established, so this is not a verified unauthenticated attack path.

Trust Boundaries and Controls

  • observed — Removing live-state membership checks moves presentation eligibility enforcement toward persisted meeting ownership. That retained database control contains notification and deletion by meeting, but deletion has no corresponding persisted pod predicate or live-state owner resolution.

Resilience and Maintainability Implications

  • observed — The dashboard now contains non-fatal message and report failures. Meeting-end processing attempts its final report and then removes meeting-scoped state even if reporting throws. This improves cleanup containment but does not provide durable final-report recovery; no security regression from that delivery limitation was established.
  • observed — The existing database queue logs and discards failed actions without retry. Notification and removal handlers therefore do not guarantee persistence completion before returning. This is a pre-existing recovery limitation, not a newly introduced database-control failure.

Hardening Proposals

  • proposed — Separate rejected-upload cleanup from live-presentation removal. When a presentation exists in live state, resolve or validate its actual owning pod and use that owner consistently for deletion, event emission, and state cleanup. Continue permitting meeting-scoped cleanup of rejected uploads absent from live pods.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description check ✅ Passed The description clearly explains the backport, the rejected-presentation toast fix, the learning-dashboard prerequisite, and the reported testing results. It is directly related to the changeset.
Title check ✅ Passed The title clearly identifies the backport and the main fix for the rejected-presentation upload-error toast. It is concise and directly related to the changeset.
Linked Issues check ✅ Passed Issue #25817 is closed and supplies historical context only. No active directly linked issue remains. Therefore, this pull request has no linked-issue coding requirements to assess.
Out of Scope Changes check ✅ Passed The presentation-handler changes address the historical rejected-presentation flow. The LearningDashboardActor changes provide the stated prerequisite protection for empty presentation histories and r…
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


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.

@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown

⏳ Automated tests are running...

@antobinary
antobinary merged commit 9abd62e into bigbluebutton:v3.0.x-develop Oct 1, 2026
30 of 32 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.

Upload error toast for a rejected presentation can't be dismissed and keeps reappearing

3 participants