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:
Checklist
Is this feature complete?
[x] Yes. Ready to ship.
[ ] No. Follow-up changes expected.
Are you including unit tests for the changes and scenario tests if relevant?
[x] 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
[x] 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
[x] No
Does the change require an update in our Aspire docs?
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 singletonTelemetryRepository
instance.Changes:
UpdateDetailViewData
created a subscription, but the subscription callback also calledUpdateDetailViewData
. In the right circumstances two subscriptions are created but only one is disposed.Profiler showing data leak when repeatedly navigating to and from trace details page:
Checklist
<remarks />
and<code />
elements on your triple slash comments?Does the change require an update in our Aspire docs?
breaking-change
template):doc-idea
template):Microsoft Reviewers: Open in CodeFlow