mirror of
https://github.com/bitwarden/browser
synced 2025-12-11 13:53:34 +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 ---------------------
|
// --------------------------- Trigger subjects ---------------------
|
||||||
private _initializeOrganizationTriggerSubject = new Subject<OrganizationId>();
|
private _initializeOrganizationTriggerSubject = new Subject<OrganizationId>();
|
||||||
private _fetchReportTriggerSubject = new Subject<void>();
|
private _fetchReportTriggerSubject = new Subject<void>();
|
||||||
|
private _markUnmarkUpdatesSubject = new Subject<ReportState>();
|
||||||
|
private _markUnmarkUpdates$ = this._markUnmarkUpdatesSubject.asObservable();
|
||||||
|
|
||||||
private _reportStateSubscription: Subscription | null = null;
|
private _reportStateSubscription: Subscription | null = null;
|
||||||
private _migrationSubscription: Subscription | null = null;
|
private _migrationSubscription: Subscription | null = null;
|
||||||
@@ -236,7 +238,9 @@ export class RiskInsightsOrchestratorService {
|
|||||||
)
|
)
|
||||||
.pipe(
|
.pipe(
|
||||||
map(() => updatedState),
|
map(() => updatedState),
|
||||||
tap((finalState) => this._rawReportDataSubject.next(finalState)),
|
tap((finalState) => {
|
||||||
|
this._markUnmarkUpdatesSubject.next(finalState);
|
||||||
|
}),
|
||||||
catchError((error: unknown) => {
|
catchError((error: unknown) => {
|
||||||
this.logService.error("Failed to save updated applicationData", error);
|
this.logService.error("Failed to save updated applicationData", error);
|
||||||
return of({ ...reportState, error: "Failed to remove a critical application" });
|
return of({ ...reportState, error: "Failed to remove a critical application" });
|
||||||
@@ -318,7 +322,9 @@ export class RiskInsightsOrchestratorService {
|
|||||||
)
|
)
|
||||||
.pipe(
|
.pipe(
|
||||||
map(() => updatedState),
|
map(() => updatedState),
|
||||||
tap((finalState) => this._rawReportDataSubject.next(finalState)),
|
tap((finalState) => {
|
||||||
|
this._markUnmarkUpdatesSubject.next(finalState);
|
||||||
|
}),
|
||||||
catchError((error: unknown) => {
|
catchError((error: unknown) => {
|
||||||
this.logService.error("Failed to save updated applicationData", error);
|
this.logService.error("Failed to save updated applicationData", error);
|
||||||
return of({ ...reportState, error: "Failed to save critical applications" });
|
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 });
|
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$,
|
initialReportLoad$,
|
||||||
manualReportFetch$,
|
manualReportFetch$,
|
||||||
newReportGeneration$,
|
newReportGeneration$,
|
||||||
|
this._markUnmarkUpdates$,
|
||||||
).pipe(
|
).pipe(
|
||||||
scan((prevState: ReportState, currState: ReportState) => ({
|
scan((prevState: ReportState, currState: ReportState) => ({
|
||||||
...prevState,
|
...prevState,
|
||||||
|
|||||||
Reference in New Issue
Block a user