From 591d431c0c3a99a8657638522bcebd74a8b7df94 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 30 Oct 2025 00:57:52 +0000 Subject: [PATCH] [PM-27291] Preserve organizationId in critical app mark/unmark updates Update removeCriticalApplication$ and saveCriticalApplications$ to preserve organizationId from the current report state when emitting mark/unmark updates. This ensures critical app flag updates maintain the organization context, allowing the scan operator to correctly identify them as same-org updates (which should preserve data) rather than org changes (which should clear data). Without this, mark/unmark updates would emit without organizationId, causing the scan operator to incorrectly treat them as new org states. --- .../domain/risk-insights-orchestrator.service.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/bitwarden_license/bit-common/src/dirt/reports/risk-insights/services/domain/risk-insights-orchestrator.service.ts b/bitwarden_license/bit-common/src/dirt/reports/risk-insights/services/domain/risk-insights-orchestrator.service.ts index f22be89ac9b..59d65d8615a 100644 --- a/bitwarden_license/bit-common/src/dirt/reports/risk-insights/services/domain/risk-insights-orchestrator.service.ts +++ b/bitwarden_license/bit-common/src/dirt/reports/risk-insights/services/domain/risk-insights-orchestrator.service.ts @@ -240,7 +240,10 @@ export class RiskInsightsOrchestratorService { .pipe( map(() => updatedState), tap((finalState) => { - this._markUnmarkUpdatesSubject.next(finalState); + this._markUnmarkUpdatesSubject.next({ + ...finalState, + organizationId: reportState.organizationId, + }); }), catchError((error: unknown) => { this.logService.error("Failed to save updated applicationData", error); @@ -324,7 +327,10 @@ export class RiskInsightsOrchestratorService { .pipe( map(() => updatedState), tap((finalState) => { - this._markUnmarkUpdatesSubject.next(finalState); + this._markUnmarkUpdatesSubject.next({ + ...finalState, + organizationId: reportState.organizationId, + }); }), catchError((error: unknown) => { this.logService.error("Failed to save updated applicationData", error);