Skip to content

[4.1] feat(presentation): insert pages into an existing presentation (from core and plugins) - #25380

Closed
imdt-claudiop wants to merge 86 commits into
bigbluebutton:v4.1.x-developfrom
imdt-claudiop:feature/insert-pages-backend
Closed

imdt-claudiop wants to merge 86 commits into
bigbluebutton:v4.1.x-developfrom
imdt-claudiop:feature/insert-pages-backend

Conversation

@imdt-claudiop

@imdt-claudiop imdt-claudiop commented Jul 7, 2026 •

Copy link
Copy Markdown
Contributor

What this does

Today a presenter who needs one more slide has to upload a whole new presentation and switch to it, losing the annotations and the flow of the deck that is already on screen. This PR lets the presenter add pages into the presentation that is already open, at a chosen position.

Two entry points:

  • Presentation toolbar (native UI). A new split button next to the slide controls, visible to the presenter, with two actions: Insert blank page and Insert pages from a file.... Pages land right after the current slide, and the presenter is taken to the first inserted page when the insert finishes.
  • Plugin SDK. A new presentation.insertPages server command, sibling of the existing presentation.upload. A plugin passes the content (file, blob, dataURL or base64, or nothing at all for a blank page) and a 1-based position.

Both paths go through the same route: the file is uploaded through the regular presentation upload endpoint with two extra fields (insertAtPosition, targetPresentationId), converted by the normal conversion pipeline as a transient presentation, and then spliced into the target. Nothing bypasses conversion, so the inserted pages get the same svg/png/textfile/thumbnail artifacts as any other slide.

Preserving existing annotations

Splicing pages into the middle of a deck used to be impossible without renumbering, and renumbering broke annotations, because a slide's identity was its page number: assets were served as .../svg/3, the tldraw store was keyed by page number, and the whiteboard rows hung off presentationId/num. Inserting a page at position 3 would have quietly moved slide 3's drawings onto the newly inserted page.

So the first half of this PR is a refactor: pageId becomes an opaque UUID minted once during conversion, and everything downstream is keyed by it instead of by position. Slide files are named by page id, the page token is signed over the page id, the tldraw store and the whiteboard queries use the page id, and recording playback reads page identity from the events with a fallback to the old numbering for recordings made before this change. num survives as what it should always have been: a mutable position attribute.

With that in place, an insert is just "move the new pages' files into the target directory and renumber positions", and every annotation stays attached to the page it was drawn on.

How a splice happens

  1. bbb-web (InsertPagesSplicer) moves the converted pages' artifacts into the target presentation's directory and re-keys pages.json, the num-to-pageId manifest, so positions at and after the insert shift up. Names are opaque ids, so nothing collides and no existing file is touched. Splices are serialized against each other.
  2. akka-apps (PresentationPagesInsertedSysMsgHdlr) re-homes the converted pages onto the target in meeting state, shifts the existing page numbers, and persists the whole thing as one transaction: the inserted rows are repointed, the shifted rows renumbered, totalPages updated and the transient insert presentation deleted. It has to be one transaction, because pres_page cascades on delete of pres_presentation and a split would cascade away the pages that were just re-homed. The (presentationId, num) unique constraint is DEFERRABLE INITIALLY DEFERRED so in-place renumbering can transiently collide inside the transaction.
  3. The client notices the inserted pages appear in the target, advances to the first one and confirms with a toast.

Configuration

public.presentation.insertPagesEnabled in settings.yml, default true.

Set it to false to hide the native toolbar button and reject inserts requested through the plugin SDK. The flag is enforced on the server too: bigbluebutton-web answers 403 insert-pages-disabled to an insert upload when the meeting has it off, so a client that ignores the setting gets nowhere.

How to test

Manual path, on a server built from this branch:

  1. Join a meeting as presenter with a multi-page presentation (the default one works) and draw something on slides 1 and 2, so there is annotation state to lose.
  2. Go to slide 1 and click the new + button in the presentation toolbar, then Insert blank page. A blank slide should appear as slide 2, the presenter should land on it, and a toast should confirm Blank slide inserted after slide 1.
  3. Check that the drawing that was on the old slide 2 is still on that slide, now numbered 3.
  4. Click + again, choose Insert pages from a file... and pick a multi-page PDF. The toast should report how many slides were inserted and after which slide.
  5. Switch to another presentation and back; the inserted pages and every annotation should still be in place.
  6. Set public.presentation.insertPagesEnabled: false, restart the html5 client, and confirm the + button is gone.

Plugin path: dispatch the presentation.insertPages server command from a plugin with a position and either a content payload or no content (blank page). Non-presenters, malformed positions and inserts while the feature is off are rejected and logged.

Recording: record a meeting in which pages are inserted, then process and play it back. Slide navigation and annotations should follow the post-insert numbering.

Testing done

  • akka-bbb-apps: 32 tests pass, including PresentationPagesInsertMathSpec.
  • bbb-common-web: InsertPagesSplicerSpec (11) and UtilIdValidationSpec (3) pass. ClientSettingsValidatorTest aborts on a jackson-databind / jackson-module-scala version conflict in the resolved dependency tree; that abort reproduces unchanged at the branch point, so it is not from this work.
  • bigbluebutton-html5: tsc --noEmit and ESLint clean.
  • bbb-export-annotations: targeted ESLint passed; the export worker produced valid PDFs for single-SVG, single-PNG and multi-SVG inputs.
  • A Playwright annotation-preservation scenario ships with the PR under bigbluebutton-tests/playwright/presentation/insert-pages-repro/, with its README describing how to run it.
  • Exercised on a from-source 4.0 environment: API returned HTTP 200, and bbb-apps-akka, bbb-export-annotations, bbb-web and nginx were active. Media paths were not exercised.

Known limitations

  • The plugin upload guard covers converting the payload to a File and the upload itself, not the asynchronous splice, so a native insert and a plugin insert can still interleave.
  • Akka state is updated independently of the queued DAO transaction. A commit failure is logged but does not roll back actor state, so memory and database can diverge. This matches how the other BBB DAOs behave.
  • If moving artifacts fails part way through a splice, the files already moved stay in the target directory. Full rollback was judged disproportionate for a filesystem failure this unlikely.
  • The combined per-presentation PDF is deliberately not spliced. It backs the download-full feature and the recording search-text loop; the visual page set is fully described by the per-page artifacts.
  • The target-presentation-disappeared notification was validated by forcing the notification event, not by racing a live splice against a presentation deletion.

@coderabbitai

coderabbitai Bot commented Jul 7, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

Adds stable opaque page IDs across presentation conversion, asset URLs, whiteboard events, recording, and playback. Adds native and plugin-driven page insertion with artifact splicing, progress messages, Akka state updates, failure cleanup, and presenter navigation. Updates page-aware GraphQL and message contracts, URL validation, tests, configuration, localization, and documentation.

Estimated code review effort: 5 (Critical) | ~120 minutes

Suggested reviewers: tainan404

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 7.55% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly and concisely identifies the main change: inserting pages into an existing presentation through core and plugin paths.
Description check ✅ Passed The description directly explains the native and plugin insertion flows, page-identity changes, validation, testing, configuration, and known limitations.
  • Fix all pre-merge checks with AI
✨ 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: 8

🧹 Nitpick comments (5)
bigbluebutton-html5/imports/ui/components/presentation/presentation-toolbar/container.jsx (1)

155-160: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Duplicate skipToSlide lookup logic.

The presentationPagesData?.pres_page.find(...) + setPresentationPage(page.pageId) pattern is duplicated verbatim in bigbluebutton-html5/imports/ui/components/whiteboard/container.jsx (lines 195-198). Consider extracting a shared helper (e.g. a useSkipToSlide(presentationId) hook alongside PRESENTATION_PAGES_SUBSCRIPTION) to avoid drift between the two implementations.

🤖 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/presentation/presentation-toolbar/container.jsx`
around lines 155 - 160, The `skipToSlide` lookup-and-select logic in
`presentation-toolbar/container.jsx` is duplicated in
`whiteboard/container.jsx`, so extract it into a shared helper or hook to keep
both callers in sync. Move the `presentationPagesData?.pres_page.find(...)` plus
`setPresentationPage(page.pageId)` behavior into a reusable
`useSkipToSlide(presentationId)`-style helper near
`PRESENTATION_PAGES_SUBSCRIPTION`, then update `skipToSlide` to use that shared
implementation.
akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/PresentationPodsApp.scala (1)

41-47: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Optional: expose a companion helper to remove the repeated (id, num) unwrap.

findPresentationPage(...).map { case (pres, page) => (pres.id, page.num) }.getOrElse(("", 0)) is duplicated verbatim in SendCursorPositionPubMsgHdlr, SendWhiteboardAnnotationPubMsgHdlr, DeleteWhiteboardAnnotationsPubMsgHdlr, and mirrored in Polls. Consider a small helper so the empty-default contract lives in one place.

♻️ Suggested helper
   def findPresentationPage(state: MeetingState2x, pageId: String): Option[(PresentationInPod, PresentationPage)] = {
     (for {
       pod <- state.presentationPodManager.getAllPresentationPodsInMeeting()
       pres <- pod.presentations.values
       page <- pres.pages.get(pageId)
     } yield (pres, page)).headOption
   }
+
+  def findPresentationPageIds(state: MeetingState2x, pageId: String): (String, Int) =
+    findPresentationPage(state, pageId).map { case (pres, page) => (pres.id, page.num) }.getOrElse(("", 0))
🤖 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
`@akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/PresentationPodsApp.scala`
around lines 41 - 47, Add a small companion/helper around findPresentationPage
in PresentationPodsApp so callers don’t repeat the same unwrap-and-default
logic. The repeated pattern in SendCursorPositionPubMsgHdlr,
SendWhiteboardAnnotationPubMsgHdlr, DeleteWhiteboardAnnotationsPubMsgHdlr, and
the mirrored Polls code should call that helper instead of manually doing
findPresentationPage(...).map { case (pres, page) => (pres.id, page.num)
}.getOrElse(("", 0)). Keep the empty-default contract in one place and use the
existing PresentationInPod and PresentationPage symbols to locate the refactor.
akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/MakePresentationDownloadReqMsgHdlr.scala (1)

105-116: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick win

Silent page skip on None — add logging for diagnosability.

If getPageByNum doesn't resolve a page number in range (e.g., a race with the new insert-pages renumbering), the page is silently dropped from the export with no trace. Since pageCount/pagesRange are computed earlier from currentPres.get.pages.size, a None here is unexpected and worth logging.

🔍 Suggested logging on the None branch
             case None =>
+              log.warn(s"Presentation page not found for export: presId=${presId}, pageNumber=${pageNumber}")
               getPresentationPagesForExport(pages, pageCount, presId, currentPres, liveMeeting, storeAnnotationPages)
🤖 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
`@akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/MakePresentationDownloadReqMsgHdlr.scala`
around lines 105 - 116, The None branch in getPresentationPagesForExport is
silently skipping a page, so add a warning/error log when
PresentationInPod.getPageByNum returns None to make the export failure
diagnosable. Use the existing context in MakePresentationDownloadReqMsgHdlr,
especially pageNumber, presId, pageCount, and currentPres.get.pages.size, and
log before recursing so unexpected gaps from renumbering or races can be traced.
akka-bbb-apps/src/main/scala/org/bigbluebutton/core/models/PresentationPods.scala (1)

64-67: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick win

Linear scan per lookup; downstream export loop makes it O(n·m).

getPageByNum scans all pages linearly since pages are now keyed by opaque id rather than number. MakePresentationDownloadReqMsgHdlr.getPresentationPagesForExport calls this once per requested page number recursively, so exporting a large page range does an O(n·m) scan instead of O(n). Consider building a Map[Int, PresentationPage] once (e.g., in the caller) when multiple lookups by number are needed in a loop.

♻️ Example: precompute an index for repeated lookups
+  def buildNumIndex(pres: PresentationInPod): Map[Int, PresentationPage] =
+    pres.pages.values.map(p => p.num -> p).toMap
+
   def getPageByNum(pres: PresentationInPod, num: Int): Option[PresentationPage] = {
     pres.pages.values find (p => p.num == num)
   }
🤖 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
`@akka-bbb-apps/src/main/scala/org/bigbluebutton/core/models/PresentationPods.scala`
around lines 64 - 67, getPageByNum in PresentationPods is doing a linear scan
over pres.pages for every lookup, which becomes expensive when
MakePresentationDownloadReqMsgHdlr.getPresentationPagesForExport calls it
repeatedly. Update the export path to precompute a Map[Int, PresentationPage]
indexed by page number once, then reuse that map for repeated lookups instead of
calling getPageByNum in a loop. Keep getPageByNum only for occasional single
lookups, and move the repeated-number access in getPresentationPagesForExport to
the cached index.
bigbluebutton-html5/imports/ui/components/plugins-engine/server-commands/presentation/insert-pages/manager.tsx (1)

15-19: 📐 Maintainability & Code Quality | 🔵 Trivial

SDK dependency remains pinned to an unreleased commit archive. Switch it back to the published package once the insertPages release is available.

🤖 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/plugins-engine/server-commands/presentation/insert-pages/manager.tsx`
around lines 15 - 19, The SDK dependency for the insert-pages server command is
still pinned to an unreleased archive, so update the package reference back to
the published plugin SDK version once the paired insertPages change is released.
Make the change in the dependency/config that the insert-pages manager relies
on, and keep the identifiers in sync with the sibling upload/manager.tsx and the
insertPages command types so the branch-only codeload reference is removed.
🤖 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
`@akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/PresentationPagesInsertedSysMsgHdlr.scala`:
- Around line 56-63: The merge/delete flow in
PresentationPagesInsertedSysMsgHdlr is split across separate DAO calls, so a
failure after PresPresentationDAO.updatePages(newTargetPres) can leave the
transient presentation row behind. Update the merge logic to perform both the
page reassignment and the delete in one transactional DBIO or a single DAO
helper, and use the existing PresentationPagesInsertedSysMsgHdlr path plus
PresPresentationDAO to make the operation all-or-nothing.
- Around line 31-35: The splice flow in PresentationPagesInsertedSysMsgHdlr is
currently split across separate queued DB actions, so updatePages and delete can
be interrupted independently. Refactor the handler around the existing newState
logic so the merge and cleanup happen inside one transactional DB action, using
the same PresentationPodsApp and presentation update/delete path, and ensure the
target presentation update and transient insert presentation removal are
committed together.

In
`@bbb-common-web/src/main/java/org/bigbluebutton/presentation/imp/InsertPagesSplicer.java`:
- Around line 40-81: The splice flow can leave the presentation partially moved
because renameAcrossArtifacts() only logs File.renameTo() failures and splice()
keeps continuing. Update InsertPagesSplicer.splice() and/or
renameAcrossArtifacts() so any failed move aborts immediately with an
IOException, or implement a full preflight/rollback strategy; use the existing
splice(), renameAcrossArtifacts(), and ARTIFACTS logic to locate the change.

In
`@bbb-common-web/src/main/java/org/bigbluebutton/presentation/imp/SlidesGenerationProgressNotifier.java`:
- Around line 175-200: sendPagesInsertedMessage currently swallows
InsertPagesSplicer.splice failures by only logging and returning, so the
client/plugin never gets a failure signal. Update this path to behave like the
other failure handlers in SlidesGenerationProgressNotifier by creating and
sending an appropriate error/progress message through messagingService when
splice throws, using the existing sendPagesInsertedMessage flow and the relevant
UploadedPresentation details to identify the presentation and meeting.

In
`@bigbluebutton-html5/imports/ui/components/plugins-engine/server-commands/presentation/insert-pages/manager.tsx`:
- Around line 86-90: The isValidInsertEvent check in manager.tsx only verifies
typeof event.detail.position === 'number', which still allows NaN, Infinity, and
non-integer values to reach insertPages. Tighten the validation in
isValidInsertEvent so position is a finite positive integer (1-based) before
dispatching the command, ensuring only valid positions are forwarded to
insertPages.

In
`@bigbluebutton-html5/imports/ui/components/presentation/presentation-toolbar/container.jsx`:
- Around line 114-121: Guard slide navigation in presentation-toolbar and
whiteboard until presentationPagesData is loaded, since skipToSlide can ignore
prev/next or picker input while pres_page is still empty during mount or
presenter changes. Update the controls in presentation-toolbar container and the
navigation handling in whiteboard container so they are disabled or blocked
while the subscription is unresolved, and only invoke skipToSlide once the page
list is available or a valid fallback page can be resolved.

In `@bigbluebutton-html5/package.json`:
- Line 82: The dependency entry for bigbluebutton-html-plugin-sdk is still
pointing at a forked GitHub tarball, while the lockfile resolves the npm
release, so installs are inconsistent. Update the package.json dependency to use
the official SDK release/tag instead of the imdt-claudiop fork, then refresh
package-lock.json so it matches the same official version. Use the
bigbluebutton-html-plugin-sdk package reference in package.json and the
generated lockfile entry to keep both sources aligned.

In
`@bigbluebutton-web/grails-app/controllers/org/bigbluebutton/web/controllers/PresentationController.groovy`:
- Around line 274-288: Reject path separators in targetPresentationId before
using it in the insert flow. In PresentationController’s insert handling, add
the same strict [A-Za-z0-9-]+ validation used elsewhere for presentation IDs
instead of only checking non-empty, and do not set uploadedPres when the ID
fails validation. This prevents
SlidesGenerationProgressNotifier.sendPagesInsertedMessage from receiving a value
that could make new File(insertDir.getParentFile(),
pres.getTargetPresentationId()) escape the meeting presentation root.

---

Nitpick comments:
In
`@akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/MakePresentationDownloadReqMsgHdlr.scala`:
- Around line 105-116: The None branch in getPresentationPagesForExport is
silently skipping a page, so add a warning/error log when
PresentationInPod.getPageByNum returns None to make the export failure
diagnosable. Use the existing context in MakePresentationDownloadReqMsgHdlr,
especially pageNumber, presId, pageCount, and currentPres.get.pages.size, and
log before recursing so unexpected gaps from renumbering or races can be traced.

In
`@akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/PresentationPodsApp.scala`:
- Around line 41-47: Add a small companion/helper around findPresentationPage in
PresentationPodsApp so callers don’t repeat the same unwrap-and-default logic.
The repeated pattern in SendCursorPositionPubMsgHdlr,
SendWhiteboardAnnotationPubMsgHdlr, DeleteWhiteboardAnnotationsPubMsgHdlr, and
the mirrored Polls code should call that helper instead of manually doing
findPresentationPage(...).map { case (pres, page) => (pres.id, page.num)
}.getOrElse(("", 0)). Keep the empty-default contract in one place and use the
existing PresentationInPod and PresentationPage symbols to locate the refactor.

In
`@akka-bbb-apps/src/main/scala/org/bigbluebutton/core/models/PresentationPods.scala`:
- Around line 64-67: getPageByNum in PresentationPods is doing a linear scan
over pres.pages for every lookup, which becomes expensive when
MakePresentationDownloadReqMsgHdlr.getPresentationPagesForExport calls it
repeatedly. Update the export path to precompute a Map[Int, PresentationPage]
indexed by page number once, then reuse that map for repeated lookups instead of
calling getPageByNum in a loop. Keep getPageByNum only for occasional single
lookups, and move the repeated-number access in getPresentationPagesForExport to
the cached index.

In
`@bigbluebutton-html5/imports/ui/components/plugins-engine/server-commands/presentation/insert-pages/manager.tsx`:
- Around line 15-19: The SDK dependency for the insert-pages server command is
still pinned to an unreleased archive, so update the package reference back to
the published plugin SDK version once the paired insertPages change is released.
Make the change in the dependency/config that the insert-pages manager relies
on, and keep the identifiers in sync with the sibling upload/manager.tsx and the
insertPages command types so the branch-only codeload reference is removed.

In
`@bigbluebutton-html5/imports/ui/components/presentation/presentation-toolbar/container.jsx`:
- Around line 155-160: The `skipToSlide` lookup-and-select logic in
`presentation-toolbar/container.jsx` is duplicated in
`whiteboard/container.jsx`, so extract it into a shared helper or hook to keep
both callers in sync. Move the `presentationPagesData?.pres_page.find(...)` plus
`setPresentationPage(page.pageId)` behavior into a reusable
`useSkipToSlide(presentationId)`-style helper near
`PRESENTATION_PAGES_SUBSCRIPTION`, then update `skipToSlide` to use that shared
implementation.
🪄 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: 913a04c7-b1f0-4163-84a2-2cab7220d42a

📥 Commits

Reviewing files that changed from the base of the PR and between 4e35cf5 and a711846.

📒 Files selected for processing (32)
  • akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/MakePresentationDownloadReqMsgHdlr.scala
  • akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/PresentationPagesInsertMath.scala
  • akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/PresentationPagesInsertedSysMsgHdlr.scala
  • akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/PresentationPodHdlrs.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/SetCurrentPagePubMsgHdlr.scala
  • akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/whiteboard/DeleteWhiteboardAnnotationsPubMsgHdlr.scala
  • akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/whiteboard/SendCursorPositionPubMsgHdlr.scala
  • akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/whiteboard/SendWhiteboardAnnotationPubMsgHdlr.scala
  • akka-bbb-apps/src/main/scala/org/bigbluebutton/core/models/Polls.scala
  • akka-bbb-apps/src/main/scala/org/bigbluebutton/core/models/PresentationPods.scala
  • akka-bbb-apps/src/main/scala/org/bigbluebutton/core/pubsub/senders/ReceivedJsonMsgHandlerActor.scala
  • akka-bbb-apps/src/main/scala/org/bigbluebutton/core/running/MeetingActor.scala
  • akka-bbb-apps/src/main/scala/org/bigbluebutton/endpoint/redis/RedisRecorderActor.scala
  • akka-bbb-apps/src/test/scala/org/bigbluebutton/core/apps/PresentationPagesInsertMathSpec.scala
  • bbb-common-message/src/main/scala/org/bigbluebutton/common2/msgs/PresentationPodsMsgs.scala
  • bbb-common-message/src/main/scala/org/bigbluebutton/common2/msgs/WhiteboardMsgs.scala
  • bbb-common-web/src/main/java/org/bigbluebutton/presentation/UploadedPresentation.java
  • bbb-common-web/src/main/java/org/bigbluebutton/presentation/imp/InsertPagesSplicer.java
  • bbb-common-web/src/main/java/org/bigbluebutton/presentation/imp/SlidesGenerationProgressNotifier.java
  • bbb-common-web/src/main/java/org/bigbluebutton/presentation/messages/DocPagesInsertedProgress.java
  • bbb-common-web/src/main/scala/org/bigbluebutton/api2/BbbWebApiGWApp.scala
  • bbb-common-web/src/main/scala/org/bigbluebutton/api2/MsgBuilder.scala
  • bbb-common-web/src/test/scala/org/bigbluebutton/presentation/imp/InsertPagesSplicerSpec.scala
  • bigbluebutton-html5/imports/ui/components/plugins-engine/server-commands/handler.tsx
  • bigbluebutton-html5/imports/ui/components/plugins-engine/server-commands/presentation/insert-pages/manager.tsx
  • bigbluebutton-html5/imports/ui/components/plugins-engine/server-commands/presentation/insert-pages/service.ts
  • bigbluebutton-html5/imports/ui/components/presentation/presentation-toolbar/container.jsx
  • bigbluebutton-html5/imports/ui/components/whiteboard/container.jsx
  • bigbluebutton-html5/imports/ui/components/whiteboard/queries.ts
  • bigbluebutton-html5/package.json
  • bigbluebutton-web/grails-app/controllers/org/bigbluebutton/web/controllers/PresentationController.groovy

@imdt-claudiop
imdt-claudiop marked this pull request as draft July 7, 2026 03:34
@imdt-claudiop imdt-claudiop changed the title feat(presentation): insert plugin pages into a presentation at a position feat(presentation): insert pages into an existing presentation Jul 7, 2026
@imdt-claudiop imdt-claudiop changed the title feat(presentation): insert pages into an existing presentation feat(presentation): insert pages into an existing presentation (from core and plugins) Jul 7, 2026
@imdt-claudiop imdt-claudiop changed the title feat(presentation): insert pages into an existing presentation (from core and plugins) [4.0] feat(presentation): insert pages into an existing presentation (from core and plugins) Jul 7, 2026
@TiagoJacobs

TiagoJacobs commented Jul 7, 2026 •

Copy link
Copy Markdown
Member

hello @imdt-claudiop

Make the following end-to-end test:

  1. On slide 1, create an annotation with the text 1a.
  2. Navigate to slide 2 and create an annotation with the text 2a.
  3. Navigate back to slide 1.
  4. Insert a new blank page.
  5. While on slide 1, navigate to "Next slide"
  6. Create an annotation with the text 1b.
  7. Verify that annotation 1a is displayed on slide 1.
  8. Click Next Slide and verify that annotation 1b is displayed.
  9. Click Next Slide again and verify that annotation 2a is displayed.

This must be in your PR evidences video as well

imdt-claudiop added a commit to imdt-claudiop/bigbluebutton that referenced this pull request Jul 7, 2026
Standalone Node/Playwright script that reproduces the reviewer-requested
scenario in PR bigbluebutton#25380: create annotations on slides 1 and 2, insert a
blank page between them, then verify the original annotations survive the
shift while the inserted blank accepts a new annotation.

The script is the verbatim reproduction used to capture the PR evidence
(not a fixture-based .spec.ts yet) so the bug it exposes - an annotation
created before an insert is lost when its slide is renumbered - can be
reproduced deterministically against any from-source BBB 4.0 server
running this feature branch. Step 9 of the scenario currently fails; see
the README and the PR discussion for the bug report and tracking.
@imdt-claudiop

Copy link
Copy Markdown
Contributor Author

E2E test result (annotation preservation scenario)

I ran the end-to-end test you requested. Steps 7 and 8 pass, step 9 fails, exposing a bug that I believe is in the prerequisite PR #25378's scope rather than this one.

What I did (verbatim scenario)

  1. Slide 1: annotation 1a - created.
  2. Slide 2: annotation 2a - created.
  3. Back to slide 1.
  4. Insert blank page (becomes slide 2; the original slide 2 with 2a shifts to slide 3).
  5. Next slide to the inserted blank.
  6. Created annotation 1b on the inserted blank.
  7. Verify 1a on slide 1 - PASS (1a visible).
  8. Verify 1b on slide 2 (inserted blank) - PASS (1b visible).
  9. Verify 2a on slide 3 (original slide 2 shifted) - FAIL. Slide 3 renders SLIDE 2 / base presentation page (the original slide content) but the annotation 2a is gone.

Evidence

The standalone reproduction script and a README are committed in this PR at bigbluebutton-tests/playwright/presentation/insert-pages-repro/. The run that captured the evidence (run7) produced these screenshots:

Diagnosis (why I think this is #25378's scope, not this PR's)

This PR's splicer shifts pres_page.num correctly and the pageId UUID stays stable (verified: the original slide 2's pageId does not change). What breaks is the whiteboard annotation lookup: the annotation 2a was created keyed to the original slide's pageId, and after the shift that pageId is still correctly attached to the now-slide-3 - yet the annotation does not render. That points to a path in #25378's refactor (the client-side whiteboard/container.jsx and the pres_page GraphQL subscription wiring) where the new pageId resolution for an already-existing annotation does not survive a num change on its slide. The splicer in this PR does not touch annotation storage or the whiteboard resolver at all; it only renumbers num.

So the fix lives in the pageId-opaque-UUID work (#25378): the whiteboard needs to reconcile annotations against the stable pageId through a num change, not drop them. I am going to pause this PR and wait for that fix to land in #25378 before re-running the scenario here.

@TiagoJacobs - per our chat, handing the fix over to the session driving #25378. Link: #25378

@TiagoJacobs

Copy link
Copy Markdown
Member

@imdt-claudiop - can you double check if you are using the latest code of #25378 ?

@imdt-claudiop

Copy link
Copy Markdown
Contributor Author

Good catch - I was not. My PR is based on the first commit of #25378 (610c7f5, "refactor: make pageId an opaque UUID"). Since then #25378 has added 8 more commits, several of which directly address the annotation-loss bug I reported here - notably 5bf9eb8 ("key the tldraw store by pageId instead of page number") and 67f47d9 ("fix: pass the real pageId to the whiteboard container"). That is almost certainly the fix for step 9 of the scenario. I will rebase this PR onto the current #25378 head (72ae3e1), re-run the E2E scenario, and report back.

imdt-claudiop added a commit to imdt-claudiop/bigbluebutton that referenced this pull request Jul 7, 2026
Standalone Node/Playwright script that reproduces the reviewer-requested
scenario in PR bigbluebutton#25380: create annotations on slides 1 and 2, insert a
blank page between them, then verify the original annotations survive the
shift while the inserted blank accepts a new annotation.

The script is the verbatim reproduction used to capture the PR evidence
(not a fixture-based .spec.ts yet) so the bug it exposes - an annotation
created before an insert is lost when its slide is renumbered - can be
reproduced deterministically against any from-source BBB 4.0 server
running this feature branch. Step 9 of the scenario currently fails; see
the README and the PR discussion for the bug report and tracking.
@imdt-claudiop
imdt-claudiop force-pushed the feature/insert-pages-backend branch from 5efc963 to cef250f Compare July 7, 2026 15:54
imdt-claudiop added a commit to imdt-claudiop/bigbluebutton that referenced this pull request Jul 9, 2026
Standalone Node/Playwright script that reproduces the reviewer-requested
scenario in PR bigbluebutton#25380: create annotations on slides 1 and 2, insert a
blank page between them, then verify the original annotations survive the
shift while the inserted blank accepts a new annotation.

The script is the verbatim reproduction used to capture the PR evidence
(not a fixture-based .spec.ts yet) so the bug it exposes - an annotation
created before an insert is lost when its slide is renumbered - can be
reproduced deterministically against any from-source BBB 4.0 server
running this feature branch. Step 9 of the scenario currently fails; see
the README and the PR discussion for the bug report and tracking.
@imdt-claudiop
imdt-claudiop force-pushed the feature/insert-pages-backend branch from 80dd855 to bf126b8 Compare July 9, 2026 19:07
@sonarqubecloud

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown

This pull request has conflicts ☹
Please resolve those so we can review the pull request.
Thanks.

The usage counter that tracks how many plugins are listening to a
given subscription can reach negative values, which is invalid and
likely indicates a bug in the unsubscribe logic.

Extract the hook usage update logic into a dedicated function that
guards against negative values and logs a warning when such an
update is attempted.
@antobinary antobinary added this to the Release 4.0 milestone Jul 24, 2026
@imdt-claudiop

Copy link
Copy Markdown
Contributor Author

Pushed commit addressing the code review findings:

  • Clamp insert position to [1, targetTotal+1] in akka (PresentationPagesInsertedSysMsgHdlr), with a warning log when the incoming position disagrees.
  • Isolate insert transaction with .transactionally.asTry and log on failure, so a rolled-back splice is observable instead of silently diverging akka state from the DB.
  • Clean up transient on missing target: if the target presentation was removed in the race window, the insert transient is now deleted (mirroring the failed-handler path) instead of leaking as a phantom.
  • Catch JsonSyntaxException in InsertPagesSplicer.readManifest and rethrow as IOException, so a corrupt pages.json flows through the existing Failed path instead of hanging silently.
  • Files.move instead of renameTo in PageArtifacts, so a failed move throws and the splice reports failure instead of claiming success with a missing artifact.
  • Migrate ClearWhiteboardEvtMsg to carry explicit presentationId/pageNum; the dead /-split helpers are deleted. No emitter exists in-repo today; a future emitter must populate the fields via PresentationPodsApp.findPresentationPage.

Validated: clean compile of bbb-common-message, bbb-common-web, akka-bbb-apps; InsertPagesSplicerSpec 11/11 and PresentationPagesInsertMathSpec 8/8 green (extended with clamp/append and corrupt-manifest cases); from-source redeploy rc=0; API HTTP 200.

Not exercised: functional end-to-end insert flow and media (WebRTC).

Known limitation: the insert transaction is isolated with asTry, but database actions are still processed through the shared Slick batch. Batch-wide failure isolation was deemed disproportionate (touches all DB actions) and is declared as a limitation.

@imdt-claudiop
imdt-claudiop force-pushed the feature/insert-pages-backend branch from 98932d2 to 16e740e Compare July 29, 2026 13:46
imdt-claudiop added a commit to imdt-claudiop/bigbluebutton that referenced this pull request Jul 29, 2026
Standalone Node/Playwright script that reproduces the reviewer-requested
scenario in PR bigbluebutton#25380: create annotations on slides 1 and 2, insert a
blank page between them, then verify the original annotations survive the
shift while the inserted blank accepts a new annotation.

The script is the verbatim reproduction used to capture the PR evidence
(not a fixture-based .spec.ts yet) so the bug it exposes - an annotation
created before an insert is lost when its slide is renumbered - can be
reproduced deterministically against any from-source BBB 4.0 server
running this feature branch. Step 9 of the scenario currently fails; see
the README and the PR discussion for the bug report and tracking.
@imdt-claudiop

Copy link
Copy Markdown
Contributor Author

Pushed commit addressing the re-review findings:

  • Fix export crash on single-page non-PDF (Medium): the export worker now reads SVG backgrounds from the validated presLocation path instead of the ordinal dropbox, getBackgroundDataURI returns null for a missing file instead of throwing, and the annotation job has a .catch so an unexpected rejection reports instead of dying silently.
  • Insert-failure UX on native toolbar (Medium/Low): the toolbar now subscribes to the insertPagesFailedNotification signal and clears inFlight + cancels the 120s timer immediately on failure, without a duplicate error toast (the global Notifications component already shows it).
  • Plugin position validation (Low): Number.isInteger(position) && position >= 1 up front, rejecting NaN/Infinity/float/negative/zero before the upload round-trip.
  • Plugin concurrency guard (Low): in-flight useRef prevents rapid double-dispatch; declared limitation: does not span the full async splice, so native+plugin interleave is still possible.
  • insertPagesEnabled on plugin path (Low): plugin command bails early when the feature is disabled, matching the native button gate.
  • Missing-target notification (Low): when the target presentation disappears before the insert message lands, the handler now sends a insertPagesFailedNotification (mirroring the failed-handler path) instead of cleaning up silently.
  • Comments/invariants (Low): akka DB fire-and-forget divergence, learn_page_key stale-id assumption, and splicer partial-move leak documented as comments.
  • Nits: removed dead pageNum: num zoom callers, fixed collector.js comment (export range vs page count), ICU plural for "1 slide".

Validated: single-SVG/single-PNG/multi-SVG exports produce PDFs; akka 32 tests; splicer 11 tests; TS/ESLint/Ruby syntax passed; forced splice failure re-enables toolbar with one toast; plugin rejects invalid positions and disabled setting; 1-page insert reads "1 slide". Media paths were not exercised.

Known limitations: plugin guard does not span full async splice; akka state vs DB divergence on commit failure (existing BBB pattern); partial-move disk leak (very low); recording page-id cache assumes stable slide numbers; missing-target notification validated by compile + forced event, not live scenario.

Branch was rebased onto v4.0.x-develop (conflict resolutions in whiteboard/component.jsx and akka-bbb-apps/build.sbt + Dependencies.scala); force-pushed.

@imdt-claudiop
imdt-claudiop force-pushed the feature/insert-pages-backend branch from 16e740e to b168532 Compare August 3, 2026 14:09
imdt-claudiop added a commit to imdt-claudiop/bigbluebutton that referenced this pull request Aug 3, 2026
Standalone Node/Playwright script that reproduces the reviewer-requested
scenario in PR bigbluebutton#25380: create annotations on slides 1 and 2, insert a
blank page between them, then verify the original annotations survive the
shift while the inserted blank accepts a new annotation.

The script is the verbatim reproduction used to capture the PR evidence
(not a fixture-based .spec.ts yet) so the bug it exposes - an annotation
created before an insert is lost when its slide is renumbered - can be
reproduced deterministically against any from-source BBB 4.0 server
running this feature branch. Step 9 of the scenario currently fails; see
the README and the PR discussion for the bug report and tracking.
@imdt-claudiop

Copy link
Copy Markdown
Contributor Author

Thanks for the thorough review, Tainan. All actionable findings are addressed in the latest push (b168532157).

Fixes implemented

[Medium] insertPagesEnabled doc/code contradiction + [Low] server enforcement (findings 1, 4)

  • The code behavior is the intended one (flag is a real gate). Fixed docs/new-features.md and the settings.yml comment to match reality.
  • Added server-side enforcement: insertPagesEnabled is now threaded from per-meeting client settings through the upload token into PresentationController.groovy, which returns 403 before any file processing when the flag is off. Fail-closed default (false) when the settings key is absent.
  • Commit: 3f06eae21b.

[Low] Count-based completion mis-attribution (finding 2)

  • Completion detection is re-keyed from raw page-count growth to a per-insert request id. The client generates a requestId (unique per session+filename), sends it with the upload, and the server echoes it back through the page urlsJson map (insertRequestId key). The completion detector now matches on page.insertRequestId === pending.requestId instead of count delta, so a concurrent plugin insert can no longer trip the native detector.
  • Full chain verified end-to-end: service.ts -> SlidesGenerationProgressNotifier -> MsgBuilder -> PresentationPagesInsertedSysMsgHdlr -> queries.ts -> container.tsx.
  • Commit: 252aa2a32f.

[Low] Unscoped failure reconciliation (finding 3)

  • Added a createdAt cursor that mirrors the canonical notifications/component.tsx pattern (greaterThanLastOne). The cursor now also advances while idle, so stale failures are consumed before the next insert starts. Also switched from .some() to .forEach() so the cursor advances past every notification in a batch.
  • Commit: 9fd4303ec3 + b168532157.

[Housekeeping] Transient insert dir cleanup on success (finding 5)

  • The transient insert presentation directory is now deleted on the success path too (after splice + DB transaction commits), matching the failure-path cleanup idiom.
  • Commit: 5ab880068e.

[Nit] Leftover comment phrase

  • Dropped a stale "page count" reference in the mid-insert comment now that completion is keyed on insertRequestId.
  • Commit: b168532157.

Declared limitations (findings 6, 7)

  • [Low] Export gate imprecision (collector.js:78): pages.length > 1 conflates export range length with page count. Not trivially fixable without risking export regression; degrades gracefully (null-guarded background read + top-level .catch). Left as-is.
  • [Very-low] Splice send outside lock: akka DocPagesInsertedProgress send happens after the synchronized splice returns. Fixing requires holding the lock during an akka send or a protocol change - not trivially safe. Theoretical, not reproduced live; affects only recording num-fallback / S3 cache-restore ordering for concurrent same-target inserts.

Known caveats (from the implementer's validation)

  • Server-side enforcement (403 on insertPagesEnabled: false) compiled and deployed, but was not exercised by a tampered/curl upload (validated via visual button-hide + plugin-block + settings readback instead).
  • The finding-2 fix (request id correlation) was validated with a single real insert and code-chain verification, not re-run against the original concurrent plugin+native repro scenario.
  • Build from-source completed on 4.0; bbb-apps-akka, bbb-web, nginx all active; HTTP 200; 11 InsertPagesSplicerSpec tests pass; real insert created the expected slide, auto-advanced correctly, and removed the transient dir.

Non-code merge blockers (unchanged, external)

Poll result shapes are built server-side with an empty meta map. The
whiteboard client keeps a remote shape only when it can tie the shape to
the presentation on screen: either meta.presentationId matches, or the
shape's whiteboardId contains the presentation id. Poll shapes never set
meta, so they relied entirely on the second branch, which held only
because page ids used to embed the presentation id (presId/pageNum).

The pageId-opaque-UUID refactor made page ids standalone UUIDs, so
whiteboardId no longer contains the presentation id, the filter started
rejecting poll shapes, and poll results stopped rendering on the
whiteboard.

Populate meta.presentationId in pollResultToWhiteboardShape, mirroring
the convention client-drawn shapes already follow on persist, so the
whiteboard filter matches poll shapes again. Deskshare polls keep an
empty presentation id, like the recorder defaults in the same method.
@imdt-claudiop
imdt-claudiop force-pushed the feature/insert-pages-backend branch from f591784 to 4801d26 Compare August 7, 2026 17:40
Match the SDK version in bbb-html5/package.json (bumped in ff03330)
so the plugin-sdk-version-check CI guard passes.
…tact

The file is CRLF in the repository. Rewriting it as LF turned a two-line
change (dropping the now-unused slideNumber) into a 135-line whole-file
diff, which hides the real change from review and would conflict with any
other work on the file. Restore the original CRLF bytes and keep only the
two lines that actually change.
bigbluebutton.properties carries an exact html5PluginSdkVersion (0.1.25)
and plugin-sdk-version-check compares it against the version resolved in
package-lock.json. A caret range lets a later npm install resolve a newer
0.1.x and silently break that match, so pin it exactly, which is also
what the branch point already did (0.1.24).
urlsJson is the page's asset urls: bbb-html5 reads svg/thumb out of it and
the plugin data-consumption layer hands the whole object to plugins. Adding
insertRequestId to that map made a client correlation token look like one
more asset url to every consumer that walks it.

Give it its own nullable pres_page column instead, exposed through
v_pres_page (presenter-scoped, like the rest of that view) and read by the
toolbar as a real field. The value is written only for pages that an insert
re-homed onto the target, and only by the DAO, so the in-memory
PresentationPage.urls map is left alone.
The insert failure notification is built with buildNotifyAllInMeetingEvtMsg,
so it reaches every client in the meeting. The toolbar resolved its pending
insert on any notification with that messageId, which means a failed insert
by one presenter silently cleared another presenter's in-flight insert: the
spinner stopped, no error was shown for the insert that was still running,
and its success toast never arrived.

Carry the request's correlation id in the notification's messageValues (both
emitters: the splice failure reported by bbb-web, and the target-presentation
-disappeared case in akka-apps) and resolve the pending insert only when the
id matches. bbb-web already knows the id as the upload's
temporaryPresentationId.
The object doc said these functions do not clamp, right above
clampedInsertPosition. akka-apps does clamp, and deliberately so: bbb-web
clamped against the manifest on disk, akka-apps decides against its own view
of the target, which can hold a different number of pages by then.
Three small things in and around applyInsertedPages:

- give it an explicit Unit return type, so the signature says what callers
  get instead of leaving it to inference through DatabaseConnection.enqueue;
- name the page-geometry literals (1440/1080 image bounds, unzoomed view
  box) once in PresPageDAO instead of repeating them at every row build,
  which is what the existing keep-in-sync comment was asking for;
- stop writing num back for pages the insert cannot have moved. Only the
  inserted pages and the ones shifted above them change position, so pages
  numbered below the insert position were getting a no-op UPDATE each.
content-to-file and the insert-pages service each exported their functions
twice, named and as a default object, so importers picked whichever style
they felt like (the toolbar container went through the default, the plugin
manager through the named exports).

Settle on one per module, following what the repo's eslint config asks for:
content-to-file has a single export, so it is the default; the service has
three, so they stay named and the container imports them that way.

Also drop the comment above the plugin insert-pages manager: half of it
repeated the imports right below it, and the other half described the SDK
still being an unpublished codeload dependency, which stopped being true
when it was pinned to the published 0.1.25.
bbb-graphql-schema.md tracks the fields each role can select. The new
pres_page column was exposed through v_pres_page and granted to bbb_client,
so it belongs in that list too.

@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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
akka-bbb-apps/src/main/scala/org/bigbluebutton/core/db/PresPresentationDAO.scala (1)

263-277: 🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift

Do not hide a failed persistence transaction.

asTry converts a database failure into Unit, and enqueue does not return the result to PresentationPagesInsertedSysMsgHdlr. That handler has already applied the inserted pages to actor state. A failed commit leaves the actor state, GraphQL state, and stored presentation files inconsistent. It also leaves the originating client request without a failure notification.

Return the transaction result to the meeting actor. Apply the in-memory merge only after commit, or send a correlated failure event and reconcile actor state after failure.

🤖 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
`@akka-bbb-apps/src/main/scala/org/bigbluebutton/core/db/PresPresentationDAO.scala`
around lines 263 - 277, The transaction in the presentation page persistence
flow must not convert failures to Unit or discard its result. Update the code
around transaction construction and DatabaseConnection.enqueue so
PresentationPagesInsertedSysMsgHdlr receives the commit outcome, applies the
in-memory page merge only after a successful commit, and sends the originating
client a correlated failure notification or otherwise reconciles actor state
when persistence fails.
🤖 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.

Outside diff comments:
In
`@akka-bbb-apps/src/main/scala/org/bigbluebutton/core/db/PresPresentationDAO.scala`:
- Around line 263-277: The transaction in the presentation page persistence flow
must not convert failures to Unit or discard its result. Update the code around
transaction construction and DatabaseConnection.enqueue so
PresentationPagesInsertedSysMsgHdlr receives the commit outcome, applies the
in-memory page merge only after a successful commit, and sends the originating
client a correlated failure notification or otherwise reconciles actor state
when persistence fails.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 3b207a96-f7dc-4771-943d-5f96e10a942e

📥 Commits

Reviewing files that changed from the base of the PR and between 6dda2a7 and 6646e3f.

⛔ Files ignored due to path filters (1)
  • bigbluebutton-html5/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (19)
  • akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/PresentationPagesInsertFailedSysMsgHdlr.scala
  • akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/PresentationPagesInsertMath.scala
  • akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/PresentationPagesInsertedSysMsgHdlr.scala
  • akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/ResizeAndMovePagePubMsgHdlr.scala
  • akka-bbb-apps/src/main/scala/org/bigbluebutton/core/db/PresPageDAO.scala
  • akka-bbb-apps/src/main/scala/org/bigbluebutton/core/db/PresPresentationDAO.scala
  • bbb-common-message/src/main/scala/org/bigbluebutton/common2/msgs/PresentationPodsMsgs.scala
  • bbb-common-web/src/main/java/org/bigbluebutton/presentation/imp/SlidesGenerationProgressNotifier.java
  • bbb-common-web/src/main/java/org/bigbluebutton/presentation/messages/DocPagesInsertFailed.java
  • bbb-common-web/src/main/scala/org/bigbluebutton/api2/MsgBuilder.scala
  • bbb-graphql-server/bbb_schema.sql
  • bbb-graphql-server/metadata/databases/BigBlueButton/tables/public_v_pres_page.yaml
  • bigbluebutton-html5/imports/ui/components/plugins-engine/server-commands/presentation/content-to-file.ts
  • bigbluebutton-html5/imports/ui/components/plugins-engine/server-commands/presentation/insert-pages/manager.tsx
  • bigbluebutton-html5/imports/ui/components/plugins-engine/server-commands/presentation/upload/manager.tsx
  • bigbluebutton-html5/imports/ui/components/presentation/presentation-toolbar/insert-pages/container.tsx
  • bigbluebutton-html5/imports/ui/components/presentation/presentation-toolbar/insert-pages/service.ts
  • bigbluebutton-html5/imports/ui/components/whiteboard/queries.ts
  • bigbluebutton-html5/package.json
💤 Files with no reviewable changes (1)
  • bigbluebutton-html5/imports/ui/components/presentation/presentation-toolbar/insert-pages/service.ts
🚧 Files skipped from review as they are similar to previous changes (13)
  • bigbluebutton-html5/package.json
  • akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/ResizeAndMovePagePubMsgHdlr.scala
  • bbb-common-web/src/main/java/org/bigbluebutton/presentation/messages/DocPagesInsertFailed.java
  • bigbluebutton-html5/imports/ui/components/plugins-engine/server-commands/presentation/upload/manager.tsx
  • akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/PresentationPagesInsertFailedSysMsgHdlr.scala
  • bigbluebutton-html5/imports/ui/components/plugins-engine/server-commands/presentation/insert-pages/manager.tsx
  • akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/PresentationPagesInsertedSysMsgHdlr.scala
  • bbb-common-web/src/main/java/org/bigbluebutton/presentation/imp/SlidesGenerationProgressNotifier.java
  • bigbluebutton-html5/imports/ui/components/presentation/presentation-toolbar/insert-pages/container.tsx
  • akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/PresentationPagesInsertMath.scala
  • bbb-graphql-server/bbb_schema.sql
  • bbb-common-message/src/main/scala/org/bigbluebutton/common2/msgs/PresentationPodsMsgs.scala
  • bbb-common-web/src/main/scala/org/bigbluebutton/api2/MsgBuilder.scala

@github-actions

Copy link
Copy Markdown

✅ Automated tests have passed!

@github-actions

Copy link
Copy Markdown

This pull request has conflicts ☹
Please resolve those so we can review the pull request.
Thanks.

@imdt-claudiop imdt-claudiop changed the title [4.0] feat(presentation): insert pages into an existing presentation (from core and plugins) [4.1] feat(presentation): insert pages into an existing presentation (from core and plugins) Sep 1, 2026
@ramonlsouza
ramonlsouza changed the base branch from v4.0.x-develop to v4.1.x-develop September 1, 2026 21:26
@ramonlsouza ramonlsouza modified the milestones: Release 4.0, Release 4.1 Sep 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants