mirror of
https://github.com/bitwarden/browser
synced 2025-12-10 21:33:27 +00:00
[PS-1906] Extract uploadEvents from EventService into new service (#4108)
* Move event.service to it's own folder Move abstractions/event.service to abstractions/event/event.service Move services/event.service to services/event/event.service Fix all the imports * Extract event-upload from event.service Move `uploadEvents` from `EventService` to `EventUploadService` Create event-upload-service-factory Fix wiring up all the dependencies * Remove clearEvents from EventService clearEvents is only related to uploading events and can be moved into EventUploadService Change the logout-method to only call EventUploadService.uploadEvents as that also calls clearEvents internally * Rename EventService to EventCollectionService Rename libs\common\abstraction\event\event.service.ts to libs\common\abstractions\event\event-collection.service.ts Rename libs\common\services\event\event.service.ts to libs\common\services\event\event-collection.service.ts Fix all the imports Fix up service regristration/instantiation Reanme \browser\src\background\service_factories\event-service.factory.ts to \browser\src\background\service_factories\event-collection-service.factory.ts * Move interval to upload events to EventUploadSvc Move the `init()` from event-collection.service to event-upload.service Change call-site in web, desktop, browser
This commit is contained in:
committed by
GitHub
parent
1dca425dc4
commit
200dd0a1fb
@@ -20,7 +20,7 @@ import { BroadcasterService } from "@bitwarden/common/abstractions/broadcaster.s
|
||||
import { CipherService } from "@bitwarden/common/abstractions/cipher.service";
|
||||
import { CollectionService } from "@bitwarden/common/abstractions/collection.service";
|
||||
import { CryptoService } from "@bitwarden/common/abstractions/crypto.service";
|
||||
import { EventService } from "@bitwarden/common/abstractions/event.service";
|
||||
import { EventUploadService } from "@bitwarden/common/abstractions/event/event-upload.service";
|
||||
import { InternalFolderService } from "@bitwarden/common/abstractions/folder/folder.service.abstraction";
|
||||
import { I18nService } from "@bitwarden/common/abstractions/i18n.service";
|
||||
import { KeyConnectorService } from "@bitwarden/common/abstractions/keyConnector.service";
|
||||
@@ -125,7 +125,7 @@ export class AppComponent implements OnInit, OnDestroy {
|
||||
private platformUtilsService: PlatformUtilsService,
|
||||
private systemService: SystemService,
|
||||
private stateService: StateService,
|
||||
private eventService: EventService,
|
||||
private eventUploadService: EventUploadService,
|
||||
private policyService: InternalPolicyService,
|
||||
private modalService: ModalService,
|
||||
private keyConnectorService: KeyConnectorService
|
||||
@@ -465,7 +465,7 @@ export class AppComponent implements OnInit, OnDestroy {
|
||||
private async logOut(expired: boolean, userId?: string) {
|
||||
const userBeingLoggedOut = await this.stateService.getUserId({ userId: userId });
|
||||
await Promise.all([
|
||||
this.eventService.uploadEvents(userBeingLoggedOut),
|
||||
this.eventUploadService.uploadEvents(userBeingLoggedOut),
|
||||
this.syncService.setLastSync(new Date(0), userBeingLoggedOut),
|
||||
this.cryptoService.clearKeys(userBeingLoggedOut),
|
||||
this.settingsService.clear(userBeingLoggedOut),
|
||||
|
||||
Reference in New Issue
Block a user