mirror of
https://github.com/bitwarden/browser
synced 2025-12-12 06:13:38 +00:00
[PM-27291] preserve critical app flags when generating new reports (#17008)
This commit is contained in:
@@ -101,6 +101,8 @@ export class RiskInsightsOrchestratorService {
|
||||
// --------------------------- Trigger subjects ---------------------
|
||||
private _initializeOrganizationTriggerSubject = new Subject<OrganizationId>();
|
||||
private _fetchReportTriggerSubject = new Subject<void>();
|
||||
private _markUnmarkUpdatesSubject = new Subject<ReportState>();
|
||||
private _markUnmarkUpdates$ = this._markUnmarkUpdatesSubject.asObservable();
|
||||
|
||||
private _reportStateSubscription: Subscription | null = null;
|
||||
private _migrationSubscription: Subscription | null = null;
|
||||
@@ -236,7 +238,9 @@ export class RiskInsightsOrchestratorService {
|
||||
)
|
||||
.pipe(
|
||||
map(() => updatedState),
|
||||
tap((finalState) => this._rawReportDataSubject.next(finalState)),
|
||||
tap((finalState) => {
|
||||
this._markUnmarkUpdatesSubject.next(finalState);
|
||||
}),
|
||||
catchError((error: unknown) => {
|
||||
this.logService.error("Failed to save updated applicationData", error);
|
||||
return of({ ...reportState, error: "Failed to remove a critical application" });
|
||||
@@ -318,7 +322,9 @@ export class RiskInsightsOrchestratorService {
|
||||
)
|
||||
.pipe(
|
||||
map(() => updatedState),
|
||||
tap((finalState) => this._rawReportDataSubject.next(finalState)),
|
||||
tap((finalState) => {
|
||||
this._markUnmarkUpdatesSubject.next(finalState);
|
||||
}),
|
||||
catchError((error: unknown) => {
|
||||
this.logService.error("Failed to save updated applicationData", error);
|
||||
return of({ ...reportState, error: "Failed to save critical applications" });
|
||||
@@ -402,10 +408,10 @@ export class RiskInsightsOrchestratorService {
|
||||
},
|
||||
};
|
||||
}),
|
||||
catchError(() => {
|
||||
catchError((): Observable<ReportState> => {
|
||||
return of({ loading: false, error: "Failed to generate or save report", data: null });
|
||||
}),
|
||||
startWith({ loading: true, error: null, data: null }),
|
||||
startWith<ReportState>({ loading: true, error: null, data: null }),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -714,6 +720,7 @@ export class RiskInsightsOrchestratorService {
|
||||
initialReportLoad$,
|
||||
manualReportFetch$,
|
||||
newReportGeneration$,
|
||||
this._markUnmarkUpdates$,
|
||||
).pipe(
|
||||
scan((prevState: ReportState, currState: ReportState) => ({
|
||||
...prevState,
|
||||
|
||||
Reference in New Issue
Block a user