Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unsubscribe from OnExtensionsChanged when unloading Extensions page #3862

Merged
merged 1 commit into from
Sep 18, 2024

Conversation

krschau
Copy link
Collaborator

@krschau krschau commented Sep 13, 2024

Summary of the pull request

We saw a crash when the extensions list updated, even though we weren't on the Extensions page. When leaving the page, we should unsubscribe from extension events, since we don't want to respond to them if there's no UI to update. Also, move subscribing out of the constructor and into the Loaded event.

References and relevant issues

Detailed description of the pull request / Additional comments

Validation steps performed

PR checklist

@AmelBawa-msft AmelBawa-msft added the Needs-Second Pull request that needs another approval label Sep 13, 2024
Comment on lines +72 to +73
_extensionService.OnExtensionsChanged -= OnExtensionsChanged;
_extensionService.OnExtensionsChanged += OnExtensionsChanged;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we do this at all? To trigger some kind of "on subscribe" event?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So we can update the page when the list changes -- for example, if something shows up in the list of extensions available in the store, and then you install it, you'll see the UI update it from being in that list to the list of installed extensions.

@krschau krschau merged commit 2a0bfbd into main Sep 18, 2024
4 checks passed
@krschau krschau removed the Needs-Second Pull request that needs another approval label Sep 18, 2024
@krschau krschau deleted the user/krschau/extensions-unloaded branch September 18, 2024 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Crash in Extensions page (formerly "Quickstart playground crash")
3 participants