Repository navigation
[3.0]test: Improve failing tests on layouts and recording - #25931
Conversation
A user joining a meeting created with meetingLayout=CAMERAS_ONLY, MEDIA_ONLY, PRESENTATION_FOCUS, ... was sometimes left on the default custom layout: sidebar, chat and whiteboard visible in a layout that is supposed to hide them. The server side was right every time (the layout row held the requested type and was never overwritten); only the joining client was wrong, and it stayed wrong until something unrelated made the layout observer render again. PushLayoutEngine resolved the layout to start with and stored it by mutating Settings.application in place. That changes the value without notifying the reactive variable behind useSettings, so LayoutObserver, which turns selectedLayout into the layout context's layoutType, only picked it up if it happened to render again afterwards. Whether it did depended on how the meeting subscription and the rest of the start-up data interleaved. Components that read the Settings singleton directly while rendering (nav bar, actions bar) did see the new value, which is why the broken state had the hidden-layout nav bar on top of the custom layout. Assign a new application object through the setter instead, which notifies the subscribers. The resolved value is the same as before. Measured on a stock 3.0 container, two users, layout checked 3 s after the second one joined, 20 joins per layout: v3.0.x-develop CAMERAS_ONLY 4/20 wrong, MEDIA_ONLY 4/20 wrong with this change CAMERAS_ONLY 0/20 wrong, MEDIA_ONLY 0/20 wrong This is what made "Meeting Layout(default) > CAMERAS_ONLY / MEDIA_ONLY" and "Enforce Layout > CUSTOM_LAYOUT" in parameters.spec.ts fail or flake in CI (e.g. the run for bigbluebutton#25917); the tests themselves are unchanged. 4.0 no longer has this code: it applies the layout through useLayoutUpdater, which dispatches the layout type itself.
"Recording > Player > Play/Pause" failed in CI with "progress bar width should not change when playback is paused" (439 px, then 447 px), on the first attempt and on the retry. The player repaints the play progress from its time updates, so the bar is still catching up for a few frames after the state it reflects has changed. Sampling the page right after a pause was acknowledged showed the media element paused with a constant currentTime while the bar grew by 5 px some 40 ms later, in 2 of 6 runs. The test took its reference width in that window whenever the runner was slow enough. Play/Pause: check the pause on the media element itself (paused, and currentTime unchanged after the wait), and take the reference width only once two consecutive readings agree. A playback that keeps running still fails: on the paused flag, on currentTime, or because the width never settles. Seek forward and backward: the same lag behind a fixed 500 ms sleep. A local run read 7.85% (the position before the seek) while the player already showed 0:00 remaining. Poll for the expected width instead.
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (3)
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review. WalkthroughPushLayoutEngine now resolves the selected layout, converts Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to The available CI report records a Player test failure but does not show that this change caused it. No verified PR-introduced regression remains to block merging. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The fix preserves layout-selection rules and existing presenter checks. More reliable updates can also activate existing meeting-wide synchronization. No security regression was established, but failure and recovery behavior for that synchronization was not fully verified. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
🚥 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 |
✅ Automated tests have passed! |
What does this PR do?
Fixes the cause of three flaky Playwright tests on 3.0 CI and stabilizes two recording player tests. Seen on the run for #25917, where none of the failures were related to that PR.
1. fix(layout): apply the meeting layout reliably when a user joins
A user joining a meeting created with
meetingLayout=CAMERAS_ONLY,MEDIA_ONLY,PRESENTATION_FOCUS, ... was sometimes left on the default custom layout, with the sidebar, chat and whiteboard visible in a layout that should hide them.PushLayoutEnginestored the resolved layout by mutatingSettings.applicationin place. That does not notify the reactive variable behinduseSettings, soLayoutObserveronly applied the layout if it happened to render again afterwards. The layout stored on the server was correct every time; only the joining client was wrong.The fix assigns a new
applicationobject through the setter. The resolved value is unchanged.This is what made these tests fail or flake, and they are not modified:
Create Parameters > Meeting Layout(default) > CAMERAS_ONLYCreate Parameters > Meeting Layout(default) > MEDIA_ONLYCreate Parameters > Enforce Layout > CUSTOM_LAYOUT4.0 no longer has this code (it applies the layout through
useLayoutUpdater).2. test(recording): stop reading the player's progress bar too early
Recording > Player > Play/Pausefailed with "progress bar width should not change when playback is paused" (439 px, then 447 px). The player repaints the play progress a few frames after the state it reflects has changed, and the test took its reference width in that window.paused, andcurrentTimeunchanged after the wait) and takes the reference width once two consecutive readings agree.How was it tested?
Stock 3.0 container, client built from this branch and from
v3.0.x-develop.Meeting Layout(default)andEnforce Layout, 16 tests x3, no retriesRecording > Player, 2 tests x12, no retriesrecording/,layouts/,parameters/(123 tests)The two that did not pass in the 123-test run:
Seek forward and backwardflaked once; that is what the second commit fixes.Hide Presentation On Join > After Uploading large presentationfails locally onv3.0.x-developas well (3 of 3 on both builds), so it is not caused by this change.The original Play/Pause failure did not reproduce locally; the late repaint was observed by sampling the page right after the pause (bar grew 5 px about 40 ms later in 2 of 6 runs while the media element was already paused).