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:
@@ -869,6 +869,7 @@ export default class MainBackground {
|
||||
this.organizationService,
|
||||
this.eventUploadService,
|
||||
this.authService,
|
||||
this.accountService,
|
||||
);
|
||||
this.totpService = new TotpService(this.cryptoFunctionService, this.logService);
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -729,6 +729,7 @@ export class ServiceContainer {
|
||||
this.organizationService,
|
||||
this.eventUploadService,
|
||||
this.authService,
|
||||
this.accountService,
|
||||
);
|
||||
|
||||
this.providerApiService = new ProviderApiService(this.apiService);
|
||||
|
||||
Reference in New Issue
Block a user