mirror of
https://github.com/bitwarden/browser.git
synced 2024-11-28 12:45:45 +01:00
[PM-7603] Fix individual vault export not appearing on Event Logs (#8829)
* Added validation to update User_ClientExportedVault on events even with no organization id or cipher id * Fixed missing data and validation
This commit is contained in:
parent
91f1d9fb86
commit
f829cdd8a7
@ -36,7 +36,7 @@ export class EventCollectionService implements EventCollectionServiceAbstraction
|
||||
const userId = await firstValueFrom(this.stateProvider.activeUserId$);
|
||||
const eventStore = this.stateProvider.getUser(userId, EVENT_COLLECTION);
|
||||
|
||||
if (!(await this.shouldUpdate(cipherId, organizationId))) {
|
||||
if (!(await this.shouldUpdate(cipherId, organizationId, eventType))) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -64,6 +64,7 @@ export class EventCollectionService implements EventCollectionServiceAbstraction
|
||||
private async shouldUpdate(
|
||||
cipherId: string = null,
|
||||
organizationId: string = null,
|
||||
eventType: EventType = null,
|
||||
): Promise<boolean> {
|
||||
const orgIds$ = this.organizationService.organizations$.pipe(
|
||||
map((orgs) => orgs?.filter((o) => o.useEvents)?.map((x) => x.id) ?? []),
|
||||
@ -85,6 +86,11 @@ export class EventCollectionService implements EventCollectionServiceAbstraction
|
||||
return false;
|
||||
}
|
||||
|
||||
// Individual vault export doesn't need cipher id or organization id.
|
||||
if (eventType == EventType.User_ClientExportedVault) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// If the cipher is null there must be an organization id provided
|
||||
if (cipher == null && organizationId == null) {
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user