Skip to content

test(cypress): defer ResizeObserver callbacks to next frame#60189

Merged
susnux merged 1 commit intomasterfrom
fix/cypress-resize-observer-loop
May 6, 2026
Merged

test(cypress): defer ResizeObserver callbacks to next frame#60189
susnux merged 1 commit intomasterfrom
fix/cypress-resize-observer-loop

Conversation

@pringelmann
Copy link
Copy Markdown
Contributor

Summary

users_manager.cy.ts has been crashing the Electron renderer on CI repeatedly. Heap snapshots ruled out OOM (dialog mount only adds ~2 MB to JS heap). A local Cypress pre-crash video shows ResizeObserver loop completed with undelivered notifications firing several times when the edit dialog and the Manager NcSelect open.

The loop seems to come from Floating UI's autoUpdate (used by NcSelect for popper positioning): each resize triggers a position recalc, which changes layout, which triggers another resize. We already suppress this as an uncaught exception in cypress/support/e2e.ts, but suppression only helps if the renderer survives. On slower CI CPUs the loop tanks the main thread until Electron's page unresponsive watchdog kills the renderer outright. Cypress then reports a generic renderer crashed with boilerplate advice about experimentalMemoryManagement and numTestsKeptInMemory (red herring, neither helped).

This patches ResizeObserver so callbacks fire on the next animation frame, breaking the synchronous loop. Workaround in the test harness, not a real fix. The proper fix belongs upstream in @nextcloud/vue and will be filed separately.

Checklist

-e
Signed-off-by: Peter Ringelmann <peter.ringelmann@nextcloud.com>
@pringelmann pringelmann self-assigned this May 6, 2026
@pringelmann pringelmann added 3. to review Waiting for reviews technical debt 🧱 🤔🚀 tests Related to tests CI labels May 6, 2026
@pringelmann pringelmann added this to the Nextcloud 34 milestone May 6, 2026
@pringelmann pringelmann marked this pull request as ready for review May 6, 2026 16:40
@pringelmann pringelmann requested a review from a team as a code owner May 6, 2026 16:40
@pringelmann pringelmann requested review from nfebe, sorbaugh and susnux and removed request for a team May 6, 2026 16:40
@susnux susnux merged commit d506de9 into master May 6, 2026
155 of 161 checks passed
@susnux susnux deleted the fix/cypress-resize-observer-loop branch May 6, 2026 16:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews CI technical debt 🧱 🤔🚀 tests Related to tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants