From 7a98772a6150dacbc685e0ac7c6cd2807838f192 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 30 Oct 2025 00:56:37 +0000 Subject: [PATCH] [PM-26676] Include organizationId in fetch and generation state emissions Update _fetchReport$ and _generateNewApplicationsReport$ methods to include organizationId in all state emissions (loading, success, error). This ensures every state update knows which organization it belongs to, enabling the scan operator to detect organization changes. Changes: - _fetchReport$: Add organizationId to all returned states - _generateNewApplicationsReport$: Add organizationId to all returned states Both methods receive organizationId as a parameter and now thread it through to all state emissions. --- .../domain/risk-insights-orchestrator.service.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 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 1c54917f132..f22be89ac9b 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 @@ -343,10 +343,11 @@ export class RiskInsightsOrchestratorService { loading: false, error: null, data: result ?? null, + organizationId, }; }), - catchError(() => of({ loading: false, error: "Failed to fetch report", data: null })), - startWith({ loading: true, error: null, data: null }), + catchError(() => of({ loading: false, error: "Failed to fetch report", data: null, organizationId })), + startWith({ loading: true, error: null, data: null, organizationId }), ); } @@ -407,12 +408,13 @@ export class RiskInsightsOrchestratorService { creationDate: new Date(), contentEncryptionKey, }, + organizationId, }; }), catchError((): Observable => { - return of({ loading: false, error: "Failed to generate or save report", data: null }); + return of({ loading: false, error: "Failed to generate or save report", data: null, organizationId }); }), - startWith({ loading: true, error: null, data: null }), + startWith({ loading: true, error: null, data: null, organizationId }), ); }