Fix listener leak: move onDidChangeConfiguration out of onDidProgressStep callback#314636
Merged
bhavyaus merged 2 commits intoMay 12, 2026
Merged
Conversation
…Step callback The onDidChangeConfiguration listener for REDUCED_MOTION_KEY was registered inside the onDidProgressStep event callback using this._register(). Each time a walkthrough step was completed, a new permanent config listener accumulated in the disposable store, never cleaned up. After completing N steps, N identical listeners existed. Move the listener registration to the constructor so it is registered exactly once, consistent with the other config/event listeners in the constructor.
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes a disposable/listener leak in the Getting Started editor by ensuring the REDUCED_MOTION_KEY configuration listener is registered exactly once for the lifetime of GettingStartedPage, rather than once per walkthrough step progress event.
Changes:
- Move
configurationService.onDidChangeConfiguration(forREDUCED_MOTION_KEY) out of theonDidProgressStepcallback. - Register that configuration listener in the constructor alongside other long-lived listeners.
roblourens
approved these changes
May 11, 2026
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.
Problem
In
GettingStartedPage, aconfigurationService.onDidChangeConfigurationlistener forREDUCED_MOTION_KEYwas registered inside theonDidProgressStepevent callback usingthis._register(). Each time a walkthrough step was completed, a new permanent config listener accumulated in the disposable store and was never cleaned up.After completing N walkthrough steps, N identical listeners existed, each toggling the same CSS class on config changes. This is the exact anti-pattern the project's coding guidelines warn about:
Fix
Move the
onDidChangeConfigurationsubscription to the constructor, alongside the other config/event listeners, so it is registered exactly once for the lifetime of the page.Fixes #315168