Repository navigation
refactor(core): Identify presentation pages by an opaque page id - #26623
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. 🗂️ Base branches to auto review: 4
Please check the settings in the CodeRabbit UI or the
|
|
This pull request has conflicts ☹ |
6c5063a to
89dfd44
Compare
|
The branch is rebased onto the current Conflict resolutions, for whoever reviews next:
Validation on the rebased head, run on a from-source environment of this branch: bbb-common-message 30 passed, akka-bbb-apps 121 passed, bbb-common-web 120 passed, bigbluebutton-web 196 executed (0 failed), presentation-conversion suite 23 passed across 7 fixtures with the page token checked per fixture (200 with token and identical bytes, 403 with a wrong token), Playwright presentation suite 7 passed, |
1dc4e2e to
e46291c
Compare
|
This is a significant change to the recording events, so make sure to update |
|
Done: bumped |
|
I'd really appreciate some documention for the recording events and recording file layout which describes the changes made between BigBlueButton versions. A good start would be to document the events and files changed by this PR, which appear to be:
|
|
This pull request has conflicts ☹ |
|
Documentation added in 17ebbb4, following the 4.0 pattern (new-features.md + development/recording.md):
The docs site build passes and the new links resolve. |
Page ids become opaque, so the messages that need a page's position no longer read it from the id: - SetCurrentPageEvtMsgBody gains pageNum. - SendWhiteboardAnnotationsEvtMsgBody, SendCursorPositionEvtMsgBody and DeleteWhiteboardAnnotationsEvtMsgBody gain pageRefs, keyed by whiteboardId, with the presentation and position of each page. - PresentationPageForExport gains pageId; page stays the position. - New SetCurrentPageByNumPubMsg asks for a page by position, with the total number of pages the client saw when it read that position. Every new field is always sent, empty when it does not apply. Co-authored-by: Ramón Souza <[email protected]>
- Find a page by id in any pod (findPresentationPage), by position in a presentation (pageByNum), and the positions of a set of pages (pageRefsFor), which the whiteboard, cursor, delete and poll result messages now carry. - The cursor is accepted only for a page of the meeting, like annotations and deletes. - SetCurrentPageByNumPubMsg converts the number with PresentationPageOrder.numNow (no order change yet, so it returns the number as sent) and then follows the SetCurrentPagePubMsg path, through the new PresentationSender.broadcastSetCurrentPageEvtMsg with pageNum. - Zoom no longer writes the page position. - The poll result shape has page:<pageId> as parent and the presentation id in meta. - Export and slide capture find each page by position instead of building presId/num. - The recorder writes the page ids of a converted presentation in page order, the position of GotoSlideEvent from pageNum, and the presentation and position of whiteboard events from pageRefs; the case for the unused ClearWhiteboardEvtMsg is removed. - The learning dashboard keeps the page id of each slide, compares slides by it, and adds converted pages to a presentation it already has (registerPages). Co-authored-by: Ramón Souza <[email protected]>
Every page of an upload gets an opaque page id (UUID v4), registered once in UploadedPresentation: minted after the page count, or adopted from a conversion cache restore. PageArtifacts is the single source of the artifact names: svgs/slide<pageId>.svg, pngs/slide-<pageId>.png, thumbnails/thumb-<pageId>.png and textfiles/slide-<pageId>.txt. - The svg, png, thumbnail and text creators write those names. The png and thumbnail renames take the temporary file of their own page instead of counting the files in the directory. - Page URLs and page tokens use the page id. The generated and completed progress messages carry the page id and the page ids in page order. - The conversion cache moves to the key <hash>.v2.tar.gz, with a manifest.json mapping page numbers to page ids. A restore extracts into a temporary directory, checks the manifest, and moves only the artifacts of the manifest's pages, renamed to new ids, so two uploads of the same file never share a page id. Entries under the old key are not read. - The module's test suites run one at a time: the presentation processing tests share ServiceUtils' static MeetingService. Co-authored-by: Ramón Souza <[email protected]>
…oints
- The svg, thumbnail, png and text routes, the slide authorization and
the nginx locations take a page id instead of a page number. An id in
any other format is answered 404, before the page token is checked;
page tokens are computed with the page id in place of the page number.
- The four endpoints that counted a presentation's slides, thumbnails,
svgs and text files are removed, with the unrouted thumbnail action.
- Specs cover the asset actions with and without pageTokenSecret, the
slide authorization, and the removed routes; the test floor goes from
110 to 149.
- The three page-id location regexes are quoted: nginx ends an unquoted
location regex token at the first brace, so the {36} quantifier
truncated the regex and pcre2_compile failed with missing closing
parenthesis (CI run 44915731527). Quoting keeps the whole regex one
token.
Co-authored-by: Ramón Souza <[email protected]>
New action that asks for the page at a position, with the total number of pages the client read together with that position (0 when unknown). It sends SetCurrentPageByNumPubMsg; presenters only. Co-authored-by: Ramón Souza <[email protected]>
The whiteboard took its page id from the page number, and built tldraw page, camera, background shape and asset ids from it. They now all come from the pageId of the current page; the number is only shown and used to ask for a page by position. - Navigation by button, by key (with or without focus on the whiteboard) and by "go to slide" sends presentationSetPageByNum with the number and the totalPages read from the same page row, at the time of the request. - The infinite whiteboard toggle sends the page id. - Snapshot and import of the current slide use the page id. - Remote shapes are matched to the presentation by meta.presentationId, which both the client and the poll result set. Co-authored-by: Ramón Souza <[email protected]>
The collector and the processor read the converted slide svgs/slide<pageId>.svg of each exported page, from the pageId that comes with it. The dropbox copy keeps the position in its name, and the PDF is still rasterized by position. Co-authored-by: Ramón Souza <[email protected]>
…e id Slides recorded with a page id use it for the live URLs and for the files of a standalone dashboard; data recorded before page ids keeps the page number. Co-authored-by: Ramón Souza <[email protected]>
A recording whose events.xml lists the page ids of its presentations (pageIds in ConversionCompletedEvent) is processed by page id as a whole; other recordings keep the numeric path unchanged. - process indexes the text of every slide by file name (slide-<pageId>), for PDF and image presentations. - publish keys slides by the page id of GotoSlideEvent and of the whiteboard events, builds the image and text paths from it, and starts a presentation at its first page. A whiteboard id that is not a page id keeps the presentation and page number key. - The preview uses the first three page ids. Co-authored-by: Ramón Souza <[email protected]>
new-features lists what changes for integrations: page links, page requests and recordings use the page id, the new presentationSetPageByNum action, the removed count endpoints, and the conversion cache starting empty. The plugin docs say currentPage.id is opaque and currentPage.num is the position. Co-authored-by: Ramón Souza <[email protected]>
The four routes that counted a presentation's slides, thumbnails, svgs and text files move under the removed routes of the bbb-web target, each with a case that expects 404 and its reviewed recording. Co-authored-by: Ramón Souza <[email protected]>
Slide URLs and tldraw page ids carry the page id, so the tests no longer build them from the page number: - Navigation checks that the slide url is /svg/<pageId>, changes, and comes back to the same url; a case with the focus on the whiteboard is added. - The slide change and slide position tests read the page id of the target page from pres_page on the presenter's page, and match /svg/<pageId> and page:<pageId>. - The snapshot of the current slide is taken on slide 2. - The poll result stays on its slide: absent on the next one, back when returning. - New page identity tests: annotations stay on their slide across a presentation switch, taking presenter then navigating and toggling the infinite whiteboard, removing a presentation while another user draws, and each slide keeping its own zoom. Co-authored-by: Ramón Souza <[email protected]>
Converted page files are named by page id, so the bbb-web target names
them with {id}, read from pres_page with the page number.
Co-authored-by: Ramón Souza <[email protected]>
Recordings made with page ids carry pageIds in ConversionCompletedEvent and name pages by page id in GotoSlideEvent, ResizeAndMoveSlideEvent and the whiteboard events. Bump bbb_version so those recordings can be told apart from older ones. Co-authored-by: Ramón Souza <[email protected]>
…and new recordings BigBlueButton::Events.presentation_page_ids (was get_page_ids) now returns the pages of every presentation shown in the recording, for old and new recordings alike: the page ids of its ConversionCompletedEvent when the recording has them, otherwise the 1-based page numbers as strings, counted from the presentation files. Page ids are opaque strings, with no format check. With that, the scripts key every slide by a string and need no separate path for each kind of recording: - process iterates the presentations and pages from presentation_page_ids, replacing get_presentations and the page count; - publish sets @version_atleast_4_1_0 with the other version flags and uses a single determine_slide_key for whiteboard events and GotoSlideEvent (pageNumber or slide before 4.1, whiteboardId or id since); - SharePresentationEvent starts a presentation at its first page, and the slide image and text paths are built the same way for every recording; - the preview takes the first three pages of the presentation. Co-authored-by: Ramón Souza <[email protected]>
…ublished files new-features lists the changes to events.xml in 4.1 (pageIds in ConversionCompletedEvent, page ids in GotoSlideEvent, ResizeAndMoveSlideEvent and the whiteboard events) and the new names of the presentation files of a recording. The recording development page describes the attributes of those events and adds AddTldrawShapeEvent and DeleteTldrawShapeEvent to the whiteboard events; the ConversionCompletedEvent row no longer lists share, which that event does not have. Co-authored-by: Ramón Souza <[email protected]>
fde3b16 to
17ebbb4
Compare
| end | ||
|
|
||
| # Gathers the text from the slide | ||
| # Gathers the text from the slide; slide is the key of the page (see Events.presentation_page_ids) |
There was a problem hiding this comment.
Comment doesn't match the code, there is no "slide" variable.
| BigBlueButton.logger.info('Created an updated metadata.xml with start_time and end_time') | ||
|
|
||
| version_atleast_2_6_0 = BigBlueButton::Events.bbb_version_compare(@doc, 2, 6, 0) | ||
| # The pages of each presentation, in page order; the files of a page are named by its key. |
There was a problem hiding this comment.
Comment wording is confusing.
Maybe something like this instead?
| # The pages of each presentation, in page order; the files of a page are named by its key. | |
| # List of slide filename keys for each presentation, in the original order. |
| # xml files as we go | ||
| last_timestamp = 0.0 | ||
| events_xml = Nokogiri::XML(File.read("#{@process_dir}/events.xml")) | ||
| # The pages of each presentation, in page order (see BigBlueButton::Events.presentation_page_ids). |
There was a problem hiding this comment.
You don't need to say "see <functionname>" in the comment for code which just calls that function.
Probably best to make this comment match the equivalent comment in process/presentation.rb
Co-authored-by: Ramón Souza <[email protected]>
|
Thanks! All three comment-wording suggestions are applied in fa196a5 (single commit, no code changes):
|
599c1d5
into
bigbluebutton:v4.1.x-develop
What does this PR do?
Every presentation page gets a fixed id: a UUID (
pageId) given to the page when it is converted, which never changes and is never reused. The page number (num) only says where the page is in the presentation. Nothing changes for presenters and viewers; this is the groundwork for inserting pages into a presentation that is already open, which needs page numbers that can change without moving annotations, zoom and text from one page to another.The page id replaces the page number everywhere a page is named:
svgs/slide<pageId>.svg,pngs/slide-<pageId>.png,thumbnails/thumb-<pageId>.png,textfiles/slide-<pageId>.txt), through a single list of artifact types (PageArtifacts). The svg, png, thumbnail and text URLs, the slide authorization, the page token and the nginx locations take the page id; a page number there answers 404. The page token is an HMAC overconference|room|presId|pageId, and the asset actions resolve their files throughresolvePresentationFile.UploadedPresentationregisters the ids of an upload once: minted after the page count, or adopted from the conversion cache. The png and thumbnail renames no longer depend on how many files the directory holds.<hash>.v2.tar.gzand carry amanifest.json(page number to page id). A restore gives the cached pages new ids, so two uploads of the same file never share a page id. Entries stored under the old key are not read, so the cache starts empty after the upgrade.pageRefs(presentation and position of each page), which the recorder writes to events.xml. The cursor is accepted only for a page of the meeting, like annotations and deletes. Zoom no longer writes the page number. The poll result shape haspage:<pageId>as parent and the presentation id inmeta.presentationSetPageByNum(presentationId, pageNum, seenTotalPages)and messageSetCurrentPageByNumPubMsg: the client sends a position with the total number of pages it saw with it, and the server converts the position if the order changed meanwhile (it cannot change yet, so the position is used as sent). The toolbar, the keys (with or without focus on the whiteboard) and "go to slide" use it.pageIdsinConversionCompletedEvent;GotoSlideEventhas the page id inid; whiteboard events have the page id inwhiteboardId, plus the presentation and position. A recording with page ids is processed by page id as a whole (published slide files andpresentation_text.jsonkeys by page id, a presentation starts at its first page, the preview shows the first three pages); a recording made before keeps the numeric path, unchanged./bigbluebutton/presentation/{conference}/{room}/{presentationName}/slides,/thumbnails,/svgs,/textfiles), and the unroutedthumbnailaction. The api-conformance suite moves them to the removed routes, each with a case that expects 404.new-features.mdlists what changes for integrations;plugins.mdsayscurrentPage.idis opaque andcurrentPage.numis the position.Closes Issue(s)
None. This replaces the page identity part of #25380.
Motivation
Pages were identified by
<presentationId>/<pageNumber>, and that id was cut back into a number in the client, the recorder, the export and the dashboard. Inserting a page would shift every number after it and move annotations, zoom, text and recordings to the wrong page. With an id that never changes, inserting pages only changes positions.For integrations
<presentationId>/<pageNumber>has no effect.Limitations
How to test
Navigation, annotations, zoom, polls, recording, export and breakout rooms work as before; the page id shows in the slide URL (
.../svg/<pageId>).Checked on a development server built from this branch (production builds of the client, bbb-web, akka-apps and graphql-actions):
Preview of the demonstration video below - click the GIF to open the full MP4 (one meeting, recorded, then the playback of that recording):
Timestamps in the MP4:
Navigation by the toolbar buttons - 00:00:12
Navigation by the arrow keys, focus outside the whiteboard - 00:00:19
Navigation by the arrow keys, whiteboard focused - 00:00:23
Navigation by "go to slide" - 00:00:28
Annotations drawn on slides 1, 2 and 3 - 00:00:34
Switch to another presentation, which has no annotations - 00:00:43
Back to the first presentation: each slide keeps its own annotations (slide 3, then 2, then 1) - 00:00:47
Poll result published on slide 4 - 00:00:56 (on the slide from 00:01:00)
The poll result is not on slide 5 and is back on slide 4 - 00:01:05
Zoom per slide: slide 5 at 150%, slide 4 at 100%, slide 5 back at 150% - 00:01:11
Slide change of issue 25397: jump to slide 9 with the first request for its image held back 1.5 s; slide 5 stays on screen until slide 9 is painted - 00:01:22, apart from at most one blank frame when the jump starts from a zoomed slide, the same as the current behaviour
Learning dashboard of the meeting, timeline with the visited pages - 00:01:54
Playback of the recording of this meeting (presentation format), slide by slide - 00:02:05: slide 3, 2 and 1 with their annotations after the presentation switch at 00:02:50, 00:02:53 and 00:02:55, the poll result on slide 4 at 00:03:03
Navigation by toolbar, by keys with and without focus on the whiteboard, and by "go to slide". The slide url is
/svg/<pageId>.GraphQL.
pres_page.contenthas the text of each page; a zoom request with a differentpageNumdoes not change the page number;presentationSetPageByNumwith a differentseenTotalPagesgoes to the position asked;presentationSetPagewith an id in the old form leaves the current page unchanged.Conversion cache (with a local S3 server): two uploads of the same file, the second restored from the cache with new page ids and only the artifacts of its pages in the upload directory; a file with only an old-key entry is converted, not restored.
Recordings. A new recording (annotations on three slides, a poll on a slide, a poll during screen sharing, a presentation removed while another user draws, a six-page presentation shared without navigating) publishes slides and texts by page id, with each annotation on its slide; the presentation starts at its first page and the preview shows pages 1, 2 and 3. Recordings made before this change, reprocessed with this branch, publish the same files, texts, annotations, polls and preview as before.
Export with annotations of a PDF, an office document, an image and a PDF with a soft mask: same pages and page sizes as before, same slide content.
Breakout rooms with the current slide and with a whole presentation receive the same pages as before; capturing slides when the rooms end works as before.
Learning dashboard: the timeline shows the thumbnails of the visited pages.
Upgrade with a running meeting: the meeting ends; a meeting created afterwards uploads, navigates and annotates normally.
Playwright: the tests that depended on the page number now read the page id (navigation, slide change, slide position, annotation allowlist), and new tests check that annotations stay on their slide across a presentation switch, that taking presenter keeps navigation and the infinite whiteboard toggle working, that removing a presentation while another user draws raises no error, that each slide keeps its own zoom, that a poll result stays on its slide, and that the snapshot works on slide 2. Run against the development server, these pass.
Unit tests
The Scala unit tests workflow (#26616) is merged, and this branch is rebased on
v4.1.x-developafter it. Output of the three Scala modules and of thebigbluebutton-websuite at heade46291cc6e. The tree differs from the one tested only in the three quoted nginx location lines, so the suite output is unchanged:bbb-common-message: sbt test (30 passed, 0 failed, 5 suites)
akka-bbb-apps: sbt test (121 passed, 0 failed, 14 suites)
bbb-common-web: sbt test (120 passed, 0 failed, 19 suites)
bigbluebutton-web: ./gradlew test (196 executed, floor 149; passed per spec)
Checks after the rebase
On a development server built from source at head
e46291cc6e(same tree as tested, apart from the three quoted nginx location lines; production builds of the client, bbb-web, akka-apps, graphql-actions and export-annotations):bigbluebutton-tests/presentation-conversion): 23 passed across 7 fixtures (PDFs, an image, a PNG, a PPTX and a file name with quotes). For each fixture, slide 1 is served with its page token (200, same bytes as on disk) and refused with a wrong one (403).tsc --noEmiton the Playwright and presentation conversion suites: rc 0.The 13th commit,
test(presentation-conversion): find page files by page id, adapts that suite: it names the converted page files by page id, read frompres_pageby page number, instead of by page number.Not run on this head: the upstream CI run at this head (pending), the official-plugins part of the plugin job, recording playback and mobile.
The Scala unit-test outputs pasted above were run locally (the mirror repo runs no Actions); the CI runs of #26616 cover the same suites.