1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-15 07:43:35 +00:00

[PM-5957] CLI - List items long runtime (#9589)

* Initial checking of collect many

* should update to better handle parameters

* cleaning up event collection params

* Adding documentation

* Removing commented out code saved for testing

* Adding pr changes and using the account service for event collection user id

* browser main.background event collection service needed the account service
This commit is contained in:
Tom
2024-06-27 08:44:43 -04:00
committed by GitHub
parent 0fc489cfa0
commit 98c6cc4a7e
6 changed files with 80 additions and 26 deletions

View File

@@ -869,6 +869,7 @@ export default class MainBackground {
this.organizationService,
this.eventUploadService,
this.authService,
this.accountService,
);
this.totpService = new TotpService(this.cryptoFunctionService, this.logService);

View File

@@ -128,17 +128,7 @@ export class ListCommand {
ciphers = this.searchService.searchCiphersBasic(ciphers, options.search, options.trash);
}
for (let i = 0; i < ciphers.length; i++) {
const c = ciphers[i];
// Set upload immediately on the last item in the ciphers collection to avoid the event collection
// service from uploading each time.
await this.eventCollectionService.collect(
EventType.Cipher_ClientViewed,
c.id,
i === ciphers.length - 1,
c.organizationId,
);
}
await this.eventCollectionService.collectMany(EventType.Cipher_ClientViewed, ciphers, true);
const res = new ListResponse(ciphers.map((o) => new CipherResponse(o)));
return Response.success(res);

View File

@@ -729,6 +729,7 @@ export class ServiceContainer {
this.organizationService,
this.eventUploadService,
this.authService,
this.accountService,
);
this.providerApiService = new ProviderApiService(this.apiService);