Repository navigation
fix: stop a thread card's follow when the card redraws or closes - #5932
Merged
Merged
Conversation
#5893 wrapped a gesture-opened card's draw in `follow` so its message ages keep advancing with the clock, but only the presenter's next paint stopped a follow, and every follow chained a closure onto the last one. Opening and closing cards without a margin repaint therefore piled up live effects and the closures holding each card's host, thread and outlets, which the render gate's closed-surfaces check read as the thread card leaking nodes and listeners on each round trip. `follow` now returns its stop alongside the draw, and the follows sit in a set a stopped follow leaves. The card keeps its draw's stop on its session and calls it when it draws again or retires, so it holds at most one follow, and the presenter's paint still stops them all. Closes #5925
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Since #5893, every thread card a gesture opens wraps its draw in
follow(browser/runtime/application.js) so the card's message ages keep advancing with the clock. But only the presenter's next paint (forget()) stopped a follow, and each follow chained a closure onto the previous one. So opening and closing cards with no margin repaint in between piled up live effects, each holding that card's host, thread and outlets. The render gate's closed-surfaces check reported this as the thread card leaking nodes and listeners on every round trip, on seven corpus pages.The card's follow now lasts as long as the card:
followreturns{drawn, stop}, and the follows sit in a set that a stopped follow leaves. Previously they sat in a chain that kept every stopped closure untilforget().stopon its session asstopDraw(annotation-overlay/thread-preview.js). It calls it before drawing again and when the session retires, so a card holds at most one follow. The presenter's paint still stops every follow, as before.This keeps what #5893 meant the follow to do: the card's ages still advance with the clock, and the margin is still painted once per card open.
Checked locally on Linux:
test_page_fixture_rendersfails onlog-retentionbefore the change, with the same counts as CI ([2486, 3592, 4385, 5178]nodes). After the change it passes on all seven pages the issue lists:log-retention,review-a-plan,ship-review,feature-gallery,thread-panel-gallery,sidebar-contentsandthread-choice-hints.test_message_age_may_shift_metadata_but_leaves_the_thread_in_placepasses for both surfaces. Its card case is the test that showed Stop measurement ranges slowing every DOM write on a long page, paint the margin once per card open, and skip clip walks for boxes off screen #5893 needs the card's draw followed.pnpm run test:runtimepasses 965 of 965, andpnpm run check:browserand pre-commit pass. A stub intests/runtime/thread-card.test.mjsnow returns the new{drawn, stop}shape.On macOS,
thread-panel-gallerytimed out (work the page deferred past presentation never landed) instead of reporting the leak. No runner here has macOS, so the next scheduledtest-macosrun after merge will show whether that timeout had the same cause.Closes #5925 — automated triage