Skip to content

Commit 2e5b848

Browse files
murataslan1Copilot
andcommitted
fix: prevent stale badge cache after badgeDisposable is cleared
Include badgeDisposable.value in the early-return cache check so that badges are properly re-applied after results are cleared (e.g. when badgeDisposable.clear() is called in the no-results branch) and tests start again. Co-authored-by: Copilot <[email protected]>
1 parent b16433a commit 2e5b848

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/vs/workbench/contrib/testing/browser/testingExplorerView.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -636,19 +636,19 @@ class ResultSummaryView extends Disposable {
636636

637637
private renderActivityBadge(countSummary: CountSummary, isRunning: boolean) {
638638
if (isRunning) {
639-
if (this.lastBadge instanceof IconBadge && this.lastBadge.icon === spinningLoading) {
639+
if (this.badgeDisposable.value && this.lastBadge instanceof IconBadge && this.lastBadge.icon === spinningLoading) {
640640
return;
641641
}
642642

643643
this.lastBadge = new IconBadge(spinningLoading, () => localize('testingRunningBadge', 'Tests are running'));
644644
} else if (countSummary && this.badgeType !== TestingCountBadge.Off && countSummary[this.badgeType] !== 0) {
645-
if (this.lastBadge instanceof NumberBadge && this.lastBadge.number === countSummary[this.badgeType]) {
645+
if (this.badgeDisposable.value && this.lastBadge instanceof NumberBadge && this.lastBadge.number === countSummary[this.badgeType]) {
646646
return;
647647
}
648648

649649
this.lastBadge = new NumberBadge(countSummary[this.badgeType], num => this.getLocalizedBadgeString(this.badgeType, num));
650650
} else if (this.crService.isEnabled()) {
651-
if (this.lastBadge instanceof IconBadge && this.lastBadge.icon === icons.testingContinuousIsOn) {
651+
if (this.badgeDisposable.value && this.lastBadge instanceof IconBadge && this.lastBadge.icon === icons.testingContinuousIsOn) {
652652
return;
653653
}
654654

0 commit comments

Comments
 (0)