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

Fix not unsubscribing in trace detail on navigation #6666

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

JamesNK
Copy link
Member

@JamesNK JamesNK commented Nov 14, 2024

Description

The trace detail page isn't unsubscribing from repository updates when navigating away. That causes a memory leak by holding onto the TraceDetail page instance from the singleton TelemetryRepository instance.

Changes:

  • TraceDetail didn't implement dispose. That means navigating away from the page never cleaned up subscriptions.
  • UpdateDetailViewData created a subscription, but the subscription callback also called UpdateDetailViewData. In the right circumstances two subscriptions are created but only one is disposed.
  • Added TraceDetail page tests

Profiler showing data leak when repeatedly navigating to and from trace details page:

image

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
    • No. Follow-up changes expected.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes
    • No
  • Did you add public API?
    • Yes
      • If yes, did you have an API Review for it?
        • Yes
        • No
      • Did you add <remarks /> and <code /> elements on your triple slash comments?
        • Yes
        • No
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
      • If yes, have you done a threat model and had a security review?
        • Yes
        • No
    • No
  • Does the change require an update in our Aspire docs?
Microsoft Reviewers: Open in CodeFlow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant