refactor(frontend): standardize menu.component subscription cleanup#5324
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5324 +/- ##
============================================
- Coverage 51.62% 51.31% -0.31%
+ Complexity 2420 2385 -35
============================================
Files 1056 1053 -3
Lines 41046 40515 -531
Branches 4407 4317 -90
============================================
- Hits 21190 20791 -399
+ Misses 18617 18525 -92
+ Partials 1239 1199 -40
*This pull request uses carry forward flags. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Contributor
|
@Ma77Ball please add tests to verify the described issue does not happen. |
Contributor
Author
|
/request-review @Yicong-Huang |
Yicong-Huang
approved these changes
Jun 6, 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.
What changes were proposed in this PR?
computingUnitStatusSubscriptionfield (and its.add()wrapper andngOnDestroyunsubscribe) inmenu.component.ts: the inner stream is already piped throughuntilDestroyed(this), so the manual aggregator did nothing.durationUpdateSubscriptionwith a declarativeswitchMappipe, so eachExecutionDurationUpdateEventcancels the previous 1s timer and starts a new one only while running, instead of imperatively unsubscribing and reassigning a field.Subscriptionimport, leaving the component on a single consistent cleanup style (untilDestroyed).Any related issues, documentation, or discussions?
Closes: #5323
How was this PR tested?
ng test --include='src/app/workspace/component/menu/menu.component.spec.ts': all 42 tests pass.Was this PR authored or co-authored using generative AI tooling?
Co-authored with Claude Opus 4.7 in compliance with ASF