Repository navigation
[4.0] refactor: make pageId opaque UUID (decouple from page num) - #25378
imdt-claudiop wants to merge 11 commits into
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
WalkthroughThis PR changes presentation page handling to use explicit presentationId and pageNum data across message schemas, backend handlers, Redis recording, and frontend slide navigation. It adds lookup helpers for resolving pages by number or page id, updates event payloads and handler wiring to include resolved page metadata, adds a unique index for presentation/page rows, and changes page id generation to UUID-based values. Estimated code review effort: 4 (Complex) | ~60 minutes Sequence Diagram(s)sequenceDiagram
participant MeetingActor
participant SendWhiteboardAnnotationPubMsgHdlr
participant PresentationPodsApp
participant RedisRecorderActor
MeetingActor->>SendWhiteboardAnnotationPubMsgHdlr: handle(msg, state, liveMeeting, bus)
SendWhiteboardAnnotationPubMsgHdlr->>PresentationPodsApp: findPresentationPage(state, whiteboardId)
PresentationPodsApp-->>SendWhiteboardAnnotationPubMsgHdlr: (presentationId, pageNum)
SendWhiteboardAnnotationPubMsgHdlr->>RedisRecorderActor: broadcast annotation event
RedisRecorderActor->>RedisRecorderActor: record presentationId and pageNum
sequenceDiagram
participant WhiteboardContainer
participant PRESENTATION_PAGES_SUBSCRIPTION
participant PresentationToolbar
participant setPresentationPage
WhiteboardContainer->>PRESENTATION_PAGES_SUBSCRIPTION: subscribe(presentationId)
PRESENTATION_PAGES_SUBSCRIPTION-->>WhiteboardContainer: pres_page[{pageId, num}]
WhiteboardContainer->>setPresentationPage: setPresentationPage(page.pageId)
PresentationToolbar->>PRESENTATION_PAGES_SUBSCRIPTION: subscribe(presentationId)
PRESENTATION_PAGES_SUBSCRIPTION-->>PresentationToolbar: pres_page[{pageId, num}]
PresentationToolbar->>setPresentationPage: setPresentationPage(page.pageId)
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
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/endpoint/redis/RedisRecorderActor.scala (1)
333-341: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick winClearWhiteboardEvtMsgBody still needs page context
RedisRecorderActor.handleClearWhiteboardEvtMsgstill derivespresentation/pageNumberby splittingwhiteboardId, butbbb-common-message/src/main/scala/org/bigbluebutton/common2/msgs/WhiteboardMsgs.scalastill definesClearWhiteboardEvtMsgBody(whiteboardId, userId, fullClear)only. WithwhiteboardIdnow being a page UUID, clear-whiteboard recordings will lose their presentation/page metadata; this message needs the samepresentationId/pageNumfields as the other whiteboard events.🤖 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/endpoint/redis/RedisRecorderActor.scala` around lines 333 - 341, Update ClearWhiteboardEvtMsgBody in WhiteboardMsgs so it carries the same presentation/page context as the other whiteboard events by adding presentationId and pageNum alongside whiteboardId, userId, and fullClear. Then adjust RedisRecorderActor.handleClearWhiteboardEvtMsg to use those new fields directly instead of splitting whiteboardId in getPageNum, keeping the clear-whiteboard recording metadata consistent with the rest of the whiteboard message flow.
🧹 Nitpick comments (2)
bigbluebutton-html5/imports/ui/components/presentation/presentation-toolbar/container.jsx (1)
155-160: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winSilent no-op when target page isn't yet in
presentationPagesData+ duplicated lookup logic.If
presentationPagesData.pres_pagehasn't loaded yet (subscription race, e.g., right after a user is promoted to presenter, since the subscription is skipped untiluserIsPresenteris true) or doesn't containslideNum,skipToSlidesilently does nothing — no warning, no retry. This self-recovers once data arrives, but a click can be lost with no feedback.This exact lookup logic is also duplicated verbatim in
bigbluebutton-html5/imports/ui/components/whiteboard/container.jsx(Lines 195-198). Consider extracting a shared helper (e.g., a small hook wrappingPRESENTATION_PAGES_SUBSCRIPTION+ lookup-by-num) to avoid the two implementations drifting.♻️ Suggested improvement
const skipToSlide = (slideNum) => { const page = (presentationPagesData?.pres_page || []).find((p) => p.num === slideNum); if (page) { setPresentationPage(page.pageId); + } else { + logger.warn({ logCode: 'presentation_skip_to_slide_page_not_found' }, `Could not resolve pageId for slide ${slideNum}`); } };🤖 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 handler in presentation-toolbar/container.jsx can silently no-op when presentationPagesData.pres_page is not loaded yet or does not contain the requested slide, and the same lookup is duplicated in whiteboard/container.jsx. Update skipToSlide to handle the missing-page case with a visible fallback/retry or at least centralized lookup behavior, and extract the slide-by-num lookup into a shared helper/hook used by both skipToSlide and the whiteboard equivalent so the logic stays consistent.akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/whiteboard/SendCursorPositionPubMsgHdlr.scala (1)
22-24: 🚀 Performance & Scalability | 🔵 Trivial | ⚖️ Poor tradeoffOptional:
findPresentationPageon the cursor hot path.Cursor-position events are high-frequency, and this now runs a pod→presentation scan for every broadcast instead of the prior constant-time id parse. Pod/presentation counts are normally small so the overhead is minor, but if profiling shows this on a hot path, consider maintaining a
pageId → (pres, page)index to keep the lookup O(1).🤖 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/whiteboard/SendCursorPositionPubMsgHdlr.scala` around lines 22 - 24, The cursor-position handler in SendCursorPositionPubMsgHdlr now does a presentation/page scan via PresentationPodsApp.findPresentationPage for every event, which can add unnecessary work on a high-frequency hot path. If profiling shows this is a bottleneck, switch to an O(1) lookup by maintaining a pageId-to-(presentation,page) index in the relevant state or helper used by SendCursorPositionPubMsgHdlr, and use that instead of scanning pods each time.
🤖 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/endpoint/redis/RedisRecorderActor.scala`:
- Around line 333-341: Update ClearWhiteboardEvtMsgBody in WhiteboardMsgs so it
carries the same presentation/page context as the other whiteboard events by
adding presentationId and pageNum alongside whiteboardId, userId, and fullClear.
Then adjust RedisRecorderActor.handleClearWhiteboardEvtMsg to use those new
fields directly instead of splitting whiteboardId in getPageNum, keeping the
clear-whiteboard recording metadata consistent with the rest of the whiteboard
message flow.
---
Nitpick comments:
In
`@akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/whiteboard/SendCursorPositionPubMsgHdlr.scala`:
- Around line 22-24: The cursor-position handler in SendCursorPositionPubMsgHdlr
now does a presentation/page scan via PresentationPodsApp.findPresentationPage
for every event, which can add unnecessary work on a high-frequency hot path. If
profiling shows this is a bottleneck, switch to an O(1) lookup by maintaining a
pageId-to-(presentation,page) index in the relevant state or helper used by
SendCursorPositionPubMsgHdlr, and use that instead of scanning pods each time.
In
`@bigbluebutton-html5/imports/ui/components/presentation/presentation-toolbar/container.jsx`:
- Around line 155-160: The skipToSlide handler in
presentation-toolbar/container.jsx can silently no-op when
presentationPagesData.pres_page is not loaded yet or does not contain the
requested slide, and the same lookup is duplicated in whiteboard/container.jsx.
Update skipToSlide to handle the missing-page case with a visible fallback/retry
or at least centralized lookup behavior, and extract the slide-by-num lookup
into a shared helper/hook used by both skipToSlide and the whiteboard equivalent
so the logic stays consistent.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: dd398756-d837-4fee-a4ef-6fd261ba73ce
📒 Files selected for processing (16)
akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/MakePresentationDownloadReqMsgHdlr.scalaakka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/PresentationPodsApp.scalaakka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/SetCurrentPagePubMsgHdlr.scalaakka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/whiteboard/DeleteWhiteboardAnnotationsPubMsgHdlr.scalaakka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/whiteboard/SendCursorPositionPubMsgHdlr.scalaakka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/whiteboard/SendWhiteboardAnnotationPubMsgHdlr.scalaakka-bbb-apps/src/main/scala/org/bigbluebutton/core/models/Polls.scalaakka-bbb-apps/src/main/scala/org/bigbluebutton/core/models/PresentationPods.scalaakka-bbb-apps/src/main/scala/org/bigbluebutton/core/running/MeetingActor.scalaakka-bbb-apps/src/main/scala/org/bigbluebutton/endpoint/redis/RedisRecorderActor.scalabbb-common-message/src/main/scala/org/bigbluebutton/common2/msgs/PresentationPodsMsgs.scalabbb-common-message/src/main/scala/org/bigbluebutton/common2/msgs/WhiteboardMsgs.scalabbb-common-web/src/main/scala/org/bigbluebutton/api2/MsgBuilder.scalabigbluebutton-html5/imports/ui/components/presentation/presentation-toolbar/container.jsxbigbluebutton-html5/imports/ui/components/whiteboard/container.jsxbigbluebutton-html5/imports/ui/components/whiteboard/queries.ts
|
hey @imdt-claudiop - please test the recordings processing as well |
|
On it. I will run a focused test of the recording pipeline on the from-source 4.0 env: create a meeting with recording on, exercise upload + skipToSlide + annotation + poll, end the meeting, let the recording process finish, and verify the playback renders the annotations and poll result correctly against the new UUID-based |
Recording pipeline test — VERIFIEDRan a focused recording cycle on the from-source 4.0 env with the PR deployed: create meeting with Pipeline processing
PlaybackPlayback URL (HTTP 200): The player renders with 6 slide thumbnails; the sine-curve annotation appears on the correct slide (player page 6 = PDF slide 5); the published poll result overlay ("Does the baseline work?" A. Yes = 1) renders at the end. No "Oops", no missing slides, no broken JS. events.xml — the UUID-specific angleSpot-checked the processed recording's
The processing also mapped the shape to the correct page in the published Legacy recording (composite id) — still replaysThe pre-refactor recording on this env ( Non-fatal, pre-existing env notes
Bottom lineThe recording pipeline correctly processes and publishes meetings recorded with the new UUID-based |
Pre-mortem: PR #25378 (pageId opaque UUID) - prospective failure analysisTask type declared: read-only prospective analysis (no baseline-mode applies: no code edited, no environment touched, no probe - the task explicitly forbids edits/deploys). Every claim below was verified by reading the diff ( Top risks (worth addressing before merge)RISK 1 and RISK 2 are the two genuinely scary ones. RISK 1 is a user-facing single point of failure added to the most-used presenter action. RISK 2 is a structural invariant silently lost - not a bug today, but the exact kind of landmine that detonates two releases later. RISK 1 - Presenter slide navigation becomes a silent no-op behind an async subscription (HIGH impact x MEDIUM likelihood)
RISK 2 - Page identity is now minted per-message, and the two mint sites no longer agree (HIGH impact x LOW likelihood today, latent)
RISK 3 - Recorder state-miss fallback writes empty presentation into events.xml and Ruby treats "" as a real bucket (MEDIUM impact x LOW-MEDIUM likelihood)
RISK 4 - New per-presenter Hasura live query is invalidated by pan/zoom (LOW-MEDIUM impact x HIGH trigger frequency)
RISK 5 - The --no-verify bypass skipped the TypeScript check too, not just eslint (LOW impact, process finding)
Verified-clear (stress-tested, no genuinely new risk found)These are reported so the reader knows they were checked, not skipped:
E2E blind spots worth a follow-up test (mode 15)
Summary for the coordinatorNenhum bloqueador ativo encontrado: os 5 mint-sites estao threaded, o formato do events.xml e realmente estavel, e os consumidores externos (middleware Go, learning dashboard, Ruby playback, mobile) foram verificados um a um no codigo. Os dois riscos que valem acao antes do merge sao o RISK 1 (navegacao do presenter virou no-op silencioso atras de subscription - pedir botao desabilitado ou fallback) e o RISK 2 (mint duplo de UUID em MsgBuilder:264 morto-na-chegada + perda de idempotencia do insert - pedir mint unico + unique constraint em presentationId,num). RISK 3 merece um log de warning barato nos 3 fallbacks. O resto e conhecido-e-aceitavel ou verificado-limpo, com a evidencia file:line acima. |
…nt, recorder warn) Follow-up hardening for the three highest-scored risks in the pre-mortem analysis (see PR comment: bigbluebutton#25378 (comment)): 1. Presenter navigation silent no-op: slide navigation resolves numbers to page ids through the pres_page subscription, so before its first payload arrives a click on prev/next/skip was silently swallowed. The toolbar controls now stay disabled until the subscription resolves, and the infinite whiteboard toggle skips the mutation instead of sending an undefined pageId into a non-nullable GraphQL field. 2. Dual mint and lost idempotency: generatePresentationPages minted a second set of UUIDs inside PresentationConversionCompletedSysPubMsg that the completed handler ignores (it rebuilds pages from meeting state). The ids there are now num-only placeholders, leaving generatePresentationPage as the single mint site. A unique index on pres_page(presentationId, num) makes a re-sent page notification fail loudly instead of inserting a duplicate row. 3. Recorder state-miss silent fallback: the whiteboard handlers fall back to ("", 0) when the page lookup misses, which used to flow into events.xml with no trace. The fallback is unchanged but now logs a warning so a miss is greppable instead of silent.
Pre-mortem ROUND 2: PR 25378 - systemic "num as identifier" inventoryTask type / baseline-mode declarado: análise prospectiva read-only (mesmo modo do round 1: nenhum código editado, nenhum ambiente tocado, probe/reversão não se aplicam - a tarefa proíbe edits/deploy). Método: diff completo (23 arquivos) + leitura dirigida da fonte + 3 varreduras paralelas exaustivas (pipeline de gravação Ruby/Scala, cliente html5, export/graphql/api/conversão). Todas as alegações estruturais (head-line) abaixo foram re-verificadas por mim no código citado (MsgBuilder, nginx, PresentationController/Service, cadeia do breakout, Polls.scala, StatusTable.jsx, o rename O texto abaixo (seções A-E, em inglês) é o entregável pronto pro comment do PR. Section A: COMPLETE INVENTORY of LEAKS (num used as identifier/key/path)Severity is relative to the insertPages goal (what must hold for Component 1: conversion pipeline and asset serving (the flagged one, now fully mapped)
Load-bearing nuance (verified): Component 2: re-derivers (rebuild asset paths from current num)
Component 3: recording (the format itself is num-keyed)
Component 4: html5 client whiteboard (tldraw is keyed by num, not pageId - the second big round-2 surprise)
Component 5: inputs and state that accept num as identity
Component 6: database
Adjacent finding (not a renumber leak, found during the sweep): Section B: ACCEPTABLE (ORDERING) / INERT - checked, not leaks
Section C: RECOMMENDED SCOPE for the fixTwo viable strategies for the asset substrate:
Recommended: Strategy 2 for the serving substrate, because the stored-URL architecture already does the right thing; the bug is only in the re-derivers. Minimum set to make num truly mutable:
Section D: RECORDING COMPATIBILITY
Section E: HONEST ASSESSMENTThis is not a small path rename; it is three follow-up work packages on top of this PR: (1) the re-deriver fixes (export, dashboard, breakout, setZoom - medium, mostly mechanical once assetIndex-vs-num is explicit), (2) the client tldraw re-key (medium, self-contained but touches persisted annotation parenting), (3) the rap re-key (the large one: cross-language, needs golden-recording tests, and is a hard prerequisite for insertPages in recorded meetings). None of it belongs in THIS PR: the PR's deliverable (stable opaque pageId, recorder writing explicit ids) is exactly the foundation the three packages build on, and it is already the enabler that makes the rap fix possible at all. One more honest caveat: even an append-only insertPages (which renumbers nobody) is not free - the inserted page's assets live under its own conversion directory, so the single-presLocation assumption in export (L5) and breakout (L7) still has to be addressed first. |
|
hello @imdt-claudiop - go with "Strategy 1 - rename the world to pageId" - be brave my friend |
|
On it. Strategy 1 (rename the world to pageId) it is. Before I start editing, I will run a plan-gate on the full scope (it touches conversion pipeline, on-disk filenames, nginx serving, HMAC token, client tldraw re-key, recording pipeline Ruby scripts, export, learning dashboard, breakout) so we agree on the boundary of this PR vs follow-ups, the legacy-recording compatibility strategy, and the dependency order. I will share the plan here for your review before any code lands. The env is up and the existing refactor commit stays as the foundation; this work builds on top of it. |
|
Before I start editing, three design questions that block the plan-gate. The pre-mortem round 2 surfaced them:
I will run the plan-gate on the full Strategy 1 scope in parallel (the answers refine the execute, not the plan structure). Share your calls when you can. |
|
Quick correction after the plan-gate ran: P-A (breakout inserted pages) is resolved - not a blocker. The gate pointed out that breakout slices the source uploaded PDF by ordinal, and the source PDF is untouched by this PR's converted-asset rename. Breakout only needs new semantics under insertPages (inserted pages don't exist in the source PDF), so it is deferred with P-A and kept as a named limitation in this PR body. It does not block Strategy 1. Two questions remain (P-B, P-C):
Plan-gate passed (scope fixes applied: L14 and L15 added to the change set, legacy on-disk fallback specified, single-mint invariant preserved, rewrite-on-read migration dropped as unnecessary). Ready to dispatch implementation once P-B and P-C are answered. |
everything in this PR
discover it, start with |
|
Got it - everything in this PR, and I will discover the Ruby deploy via record-and-playback/deploy.sh. Dispatching implementation now (fable). Will report back with the diff and the validation once it converges; the recording pipeline (rap re-key) remains the accepted high-risk piece. |
|
…nt, recorder warn) Follow-up hardening for the three highest-scored risks in the pre-mortem analysis (see PR comment: bigbluebutton#25378 (comment)): 1. Presenter navigation silent no-op: slide navigation resolves numbers to page ids through the pres_page subscription, so before its first payload arrives a click on prev/next/skip was silently swallowed. The toolbar controls now stay disabled until the subscription resolves, and the infinite whiteboard toggle skips the mutation instead of sending an undefined pageId into a non-nullable GraphQL field. 2. Dual mint and lost idempotency: generatePresentationPages minted a second set of UUIDs inside PresentationConversionCompletedSysPubMsg that the completed handler ignores (it rebuilds pages from meeting state). The ids there are now num-only placeholders, leaving generatePresentationPage as the single mint site. A unique index on pres_page(presentationId, num) makes a re-sent page notification fail loudly instead of inserting a duplicate row. 3. Recorder state-miss silent fallback: the whiteboard handlers fall back to ("", 0) when the page lookup misses, which used to flow into events.xml with no trace. The fallback is unchanged but now logs a warning so a miss is greppable instead of silent.
|
This pull request has conflicts ☹ |
…nt, recorder warn) Follow-up hardening for the three highest-scored risks in the pre-mortem analysis (see PR comment: bigbluebutton#25378 (comment)): 1. Presenter navigation silent no-op: slide navigation resolves numbers to page ids through the pres_page subscription, so before its first payload arrives a click on prev/next/skip was silently swallowed. The toolbar controls now stay disabled until the subscription resolves, and the infinite whiteboard toggle skips the mutation instead of sending an undefined pageId into a non-nullable GraphQL field. 2. Dual mint and lost idempotency: generatePresentationPages minted a second set of UUIDs inside PresentationConversionCompletedSysPubMsg that the completed handler ignores (it rebuilds pages from meeting state). The ids there are now num-only placeholders, leaving generatePresentationPage as the single mint site. A unique index on pres_page(presentationId, num) makes a re-sent page notification fail loudly instead of inserting a duplicate row. 3. Recorder state-miss silent fallback: the whiteboard handlers fall back to ("", 0) when the page lookup misses, which used to flow into events.xml with no trace. The fallback is unchanged but now logs a warning so a miss is greppable instead of silent.
…nt, recorder warn) Follow-up hardening for the three highest-scored risks in the pre-mortem analysis (see PR comment: bigbluebutton#25378 (comment)): 1. Presenter navigation silent no-op: slide navigation resolves numbers to page ids through the pres_page subscription, so before its first payload arrives a click on prev/next/skip was silently swallowed. The toolbar controls now stay disabled until the subscription resolves, and the infinite whiteboard toggle skips the mutation instead of sending an undefined pageId into a non-nullable GraphQL field. 2. Dual mint and lost idempotency: generatePresentationPages minted a second set of UUIDs inside PresentationConversionCompletedSysPubMsg that the completed handler ignores (it rebuilds pages from meeting state). The ids there are now num-only placeholders, leaving generatePresentationPage as the single mint site. A unique index on pres_page(presentationId, num) makes a re-sent page notification fail loudly instead of inserting a duplicate row. 3. Recorder state-miss silent fallback: the whiteboard handlers fall back to ("", 0) when the page lookup misses, which used to flow into events.xml with no trace. The fallback is unchanged but now logs a warning so a miss is greppable instead of silent.
The page id was built as "<presentationId>/<pageNumber>", which forced several components to derive one value from the other by string parsing or reconstruction. This change mints the page id as a random UUID at the single mint point (bbb-web conversion messages) and threads the page number and presentation id explicitly wherever they were being parsed out of the composite id: - MsgBuilder (bbb-common-web): mint UUID page ids; num already travels as a separate field in the page VOs. - SetCurrentPageEvtMsg, SendWhiteboardAnnotationsEvtMsg, SendCursorPositionEvtMsg and DeleteWhiteboardAnnotationsEvtMsg bodies now carry explicit presentationId/pageNum fields, resolved in the publishing handlers from MeetingState2x (same pattern the poll handlers use for state threading). - RedisRecorderActor reads the explicit fields instead of splitting the whiteboard id, keeping events.xml unchanged (integer slide and pageNumber values, zero-based as before). - MakePresentationDownloadReqMsgHdlr looks pages up by number in the page model instead of rebuilding the composite id. - The HTML5 client resolves page number to pageId through a new pres_page subscription (presenter-only permission already in place) instead of rebuilding the id at skipToSlide and infinite whiteboard call sites. Poll ids keep the "<pageId>/<timestamp>" form (the prefix match in Polls.getRunningPollThatStartsWith is preserved). Legacy recordings are unaffected: the presentation player reads integer page numbers from events.xml and never parses the id. Existing rows in pres_page use varchar ids, so UUIDs need no schema migration.
…nt, recorder warn) Follow-up hardening for the three highest-scored risks in the pre-mortem analysis (see PR comment: bigbluebutton#25378 (comment)): 1. Presenter navigation silent no-op: slide navigation resolves numbers to page ids through the pres_page subscription, so before its first payload arrives a click on prev/next/skip was silently swallowed. The toolbar controls now stay disabled until the subscription resolves, and the infinite whiteboard toggle skips the mutation instead of sending an undefined pageId into a non-nullable GraphQL field. 2. Dual mint and lost idempotency: generatePresentationPages minted a second set of UUIDs inside PresentationConversionCompletedSysPubMsg that the completed handler ignores (it rebuilds pages from meeting state). The ids there are now num-only placeholders, leaving generatePresentationPage as the single mint site. A unique index on pres_page(presentationId, num) makes a re-sent page notification fail loudly instead of inserting a duplicate row. 3. Recorder state-miss silent fallback: the whiteboard handlers fall back to ("", 0) when the page lookup misses, which used to flow into events.xml with no trace. The fallback is unchanged but now logs a warning so a miss is greppable instead of silent.
… by it The page UUID is now minted when the page files are first written to disk (single mint point in PresentationFileProcessor, before any creator runs), instead of in MsgBuilder after conversion. All on-disk filenames become pageId-based (svgs/slide-<pageId>.svg, pngs/slide-<pageId>.png, thumbnails/thumb-<pageId>.png, textfiles/slide-<pageId>.txt), the asset URLs and the HMAC pageToken are derived from the pageId instead of the page number, and nginx plus the grails fallback controller serve and authorize by pageId. A pages.json manifest in the presentation directory records the number-to-id mapping: it keeps S3 conversion-cache restores coherent and gives downstream consumers (recording pipeline) a way to resolve page files without the events.
The client whiteboard used the page number as the identity of every tldraw record: page ids, cameras, the background shape, the asset id, the presence currentPageId, the zoom persistence cache and the slide snapshot lookup. They all move to the opaque pageId, so a page's client-side state no longer depends on its position. The component now receives both curPageId (identity) and curPageNum (ordinal, still used for arrow-key navigation and display). Server-generated poll result annotations parent to page:<pageId> to match.
Consumers that rebuilt an asset path from the current page number now use the page identity instead. The export/capture job carries the pageId in PresentationPageForExport so bbb-export-annotations reads svgs/slide-<pageId>.svg; the learning dashboard timeline records the pageId and builds slide and thumbnail URLs from it; presentationSetZoom drops the redundant pageNum/slideNumber field (the lookup is already by pageId, and the field let a stale client overwrite the server-side page number); the firstPageThumbnailUrl view no longer assumes a page with num=1 exists.
The presentation publish script keyed shapes, navigation and slide assets by the page number, ignoring the page ids the recorder writes. Shapes and slides are now keyed by the page's stable identity, resolved in fallback order: the explicit id in the event (<id> on GotoSlideEvent, <whiteboardId> on whiteboard events), the pages.json manifest written at conversion, a mapping learned from whiteboard events (covers the initial slide of a recording that has no GotoSlideEvent), and finally the composite <presentationId>/<pageNum> form, which is exactly the id older recordings carry, so legacy events.xml files keep replaying unchanged. Slide image and text file names are resolved by existence check (pageId-named files on current recordings, number-named on older ones), and the process step and preview thumbnails resolve page files through the manifest.
The presentation area passed curPageId built from the page number, and the container's prop spread let it override the pageId-based value computed from the subscription, so every tldraw record was still keyed by number (found live: the store had page:1 while the background shape was parented to the pageId-keyed page, leaving slides blank).
formatAnnotations is exported but imported nowhere (the live path is processAnnotations in the whiteboard container), and its poll filter parsed the page number out of the annotation id, which no longer contains one.
The 2.3 playback player derives the thumbnail strip with
src.replace("slide-", "thumbnails/thumb-"), so a slide-<pageId>.svg href
turned into a broken svgs/thumbnails/thumb-<pageId>.svg path and the strip
went blank (found live comparing against a pre-refactor recording, where
slide<n>.svg passes through untouched and the slide itself is the thumb).
Keep the historical svg convention (slide<x>.svg, no separator) with the
pageId substituted; pngs, thumbnails and textfiles keep their own historical
hyphenated forms, which that transform maps correctly.
With opaque page ids, num is a mutable position attribute of a stable identity, which makes in-place renumbering (shifting pages to open room for an insert, reordering) a legitimate operation of the model. A plain unique index is checked per row, so any shift transiently collides even inside a single UPDATE whose final state is unique. Replace the index with a UNIQUE constraint DEFERRABLE INITIALLY DEFERRED: the same backing index keeps serving the planner and the same protection holds (a re-sent page notification still cannot insert a duplicate row), only checked at commit time instead of per statement.
5b7dccc to
8c790ff
Compare
The pageId-opaque-UUID refactor (PR bigbluebutton#25378) changed slide asset paths from numbered (/svgs/slide1.svg) to pageId-based (/svgs/slide<pageId>.svg). Update checkSvgIndex and call-sites to verify slide navigation by checking the slide src changes, not by matching a hardcoded path number.
…nt, recorder warn) Follow-up hardening for the three highest-scored risks in the pre-mortem analysis (see PR comment: bigbluebutton#25378 (comment)): 1. Presenter navigation silent no-op: slide navigation resolves numbers to page ids through the pres_page subscription, so before its first payload arrives a click on prev/next/skip was silently swallowed. The toolbar controls now stay disabled until the subscription resolves, and the infinite whiteboard toggle skips the mutation instead of sending an undefined pageId into a non-nullable GraphQL field. 2. Dual mint and lost idempotency: generatePresentationPages minted a second set of UUIDs inside PresentationConversionCompletedSysPubMsg that the completed handler ignores (it rebuilds pages from meeting state). The ids there are now num-only placeholders, leaving generatePresentationPage as the single mint site. A unique index on pres_page(presentationId, num) makes a re-sent page notification fail loudly instead of inserting a duplicate row. 3. Recorder state-miss silent fallback: the whiteboard handlers fall back to ("", 0) when the page lookup misses, which used to flow into events.xml with no trace. The fallback is unchanged but now logs a warning so a miss is greppable instead of silent.
The pageId-opaque-UUID refactor (PR bigbluebutton#25378) changed slide asset paths from numbered (/svgs/slide1.svg) to pageId-based (/svgs/slide<pageId>.svg). Update checkSvgIndex and call-sites to verify slide navigation by checking the slide src changes, not by matching a hardcoded path number.
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.
🚨 Automated tests failed |
|
@imdt-claudiop |
|
This pull request has conflicts ☹ |
|
closing as the changes made in this pr are included in #25380 |
|
Thanks for flagging these three areas, Gustavo. They are all in scope and being tracked on the successor PR (#25380, the For visibility on each:
PR 25378 was closed by the maintainer because its refactor is included wholesale in 25380. Further validation of these three surfaces is happening on 25380's thread. If you would like a dedicated, isolated test run against any one of them, say so here and I will pick it up. |



refactor: make pageId opaque UUID (decouple from page num)
What this changes (and why)
pageIdtoday is not opaque: it is constructed as"<presId>/<num>"and that composite leaks the page's ordinal position into the id itself. This coupling blocks features that need to renumber slides mid-presentation (e.g.insertPages(position, file)in the plugin SDK), because renumberingnumwould silently break whiteboard navigation, recording playback, and poll-to-slide linkage, all of which derivenum(orpresId) by splitting the id on"/".This PR is preparatory: it makes
pageIdan opaque UUID (v4) minted once at page creation, withnumcarried as a separate, independently-mutable order field. The feature (insertPages) lands in a follow-up PR built on top of the now-stablepageId. No user-facing behavior changes: this is a pure refactor validated end-to-end against the pre-refactor baseline.How it works (the design decision)
MsgBuilder(bbb-common-web) now mintspageId = java.util.UUID.randomUUID().toStringat the two page-creation sites (:154,:264). UUID v4 was chosen over ULID becausejava.util.UUIDis already a project dependency (Util.java) andpres_page.numalready provides ordering; there is no value in a sortable id. The compositepresId/numform is gone.RedisRecorderActorused to split the id (getPageNum/getPresentationId) to recoverpageNumber/presentationIdfor the recording'sevents.xml. OncepageIdis a UUID with no"/", that split silently returns0/""and annotations lose their slide association. The 4 live recorder paths now read explicitpresentationId/pageNumfields propagated onto the Evt message bodies (bbb-common-message), populated at each Evt's mint site. The recordedevents.xmlformat is unchanged (still integers), so already-processed recordings stay replayable.SendWhiteboardAnnotation,SendCursorPosition,DeleteWhiteboardAnnotations) previously received onlyliveMeeting(which does not hold the page model). They now takestate: MeetingState2x, replicating the existing poll-handler dispatch pattern, and resolvepresentationId/pageNumvia two small helpers (findPresentationPage,getPageByNum) overPresentationInPod.pages. Missing pod/presentation/page returnsOptionand skips gracefully (upload-race safe).pageId = \${presentationId}/${num}`(skipToSlideinwhiteboard/container.jsxandpresentation-toolbar/container.jsx;setPresentationPageInfiniteWhiteboardin the toolbar) now obtain the opaquepageIdfrom a newpres_pageGraphQL subscription (all pages of the current presentation, exposingnum+pageId). The server-side infra already exists: thev_pres_pageview is exposed via Hasura with a presenter-only permission that matches exactly the 3 call sites. The alternative route (client sendsnum`, server resolves) would have touched 8 graphql-actions + 4 handlers without state, rejected as disproportionate.Polls.scala):pollIdis minted as"<pageId>/<timestamp>"for prefix-matching viagetRunningPollThatStartsWith. WithpageIdnow a UUID, that form still holds and the prefix-match is preserved. A 5th mint ofSendWhiteboardAnnotationsEvtMsgBody(poll-result broadcast,Polls.scala:145) was found during implementation and threaded with the new fields in-place (pres/pagein scope from the enclosing for-comprehension).getPageNum/getPresentationIdsplit helpers, but the path is unreachable in 4.0 (no producer ofClearWhiteboardEvtMsgexists; "clear all" goes throughDeleteWhiteboardAnnotationswith an empty list). Marked legacy; not worth threading fields into a dead path.No data migration, no schema change
pres_page.pageIdisvarchar(100)PRIMARY KEY: a UUID string fits without a column-type migration. Pages already persisted with the compositepresId/numid only exist in already-processed recordings (static SVG/HTML on disk); the Ruby player reads integerpageNumber/slidefromevents.xmland never parses the id, so legacy recordings replay unchanged. New recordings write integer fields via the now-field-driven recorder.Validation (E2E in a running from-source BBB 4.0)
Baseline (pre-refactor) and after-refactor runs of the same flow were recorded and compared:
skipToSlide(Slide 5) → hand-drawn annotation → custom poll (attendee responded) → publish poll result to whiteboard → recording active.events.xmldiff is only<whiteboardId>becoming a UUID (which the Ruby player does not parse); all<slide>/<pageNumber>integers unchanged.Preview below: click each GIF for the full MP4 (with controls). Navigation moments in each MP4: skipToSlide at ~00:24, annotation + poll at ~00:50.
Baseline (pre-refactor):
After (post-refactor, identical UX):
Not covered by the E2E (declared, not omitted)
Breakout rooms, multi-pod presentations, cursor rendered in a second browser viewer, and
bigbluebutton-mobile(separate repo, not in this clone) were not exercised. The decoupling paths for these resolve through the samefindPresentationPagescan (UUID uniqueness makes it robust across pods) and the same Evt-field-propagation pattern, but they are honestly untested.Follow-up
insertPages(position, file)in the plugin SDK: blocked until this lands.