From 514e2ca6644a41236469c8c217fad0772d9d7203 Mon Sep 17 00:00:00 2001 From: Jordan Aasen <166539328+jaasen-livefront@users.noreply.github.com> Date: Tue, 18 Mar 2025 08:51:11 -0700 Subject: [PATCH 1/4] [PM-17673] - fix loading state for vault popup items service (#13711) * fix loading state for vault popup items service * fix tests * add fallback in collectPageDetailsFromTab$ * add pageDetailsTimeout to autofill service --- .../src/autofill/services/autofill.service.ts | 27 ++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/apps/browser/src/autofill/services/autofill.service.ts b/apps/browser/src/autofill/services/autofill.service.ts index e833420b859..ed8b2033209 100644 --- a/apps/browser/src/autofill/services/autofill.service.ts +++ b/apps/browser/src/autofill/services/autofill.service.ts @@ -1,7 +1,16 @@ // FIXME: Update this file to be type safe and remove this and next line // @ts-strict-ignore -import { filter, firstValueFrom, merge, Observable, ReplaySubject, scan, startWith } from "rxjs"; -import { pairwise } from "rxjs/operators"; +import { + filter, + firstValueFrom, + merge, + Observable, + ReplaySubject, + scan, + startWith, + timer, +} from "rxjs"; +import { map, pairwise, share, takeUntil } from "rxjs/operators"; import { EventCollectionService } from "@bitwarden/common/abstractions/event/event-collection.service"; import { AccountInfo, AccountService } from "@bitwarden/common/auth/abstractions/account.service"; @@ -146,7 +155,19 @@ export default class AutofillService implements AutofillServiceInterface { pageDetailsFallback$.next([]); } - return merge(pageDetailsFromTab$, pageDetailsFallback$); + // Share the pageDetailsFromTab$ observable so that multiple subscribers don't trigger multiple executions. + const sharedPageDetailsFromTab$ = pageDetailsFromTab$.pipe(share()); + + // Create a timeout observable that emits an empty array if pageDetailsFromTab$ hasn't emitted within 1 second. + const pageDetailsTimeout$ = timer(1000).pipe( + map(() => []), + takeUntil(sharedPageDetailsFromTab$), + ); + + // Merge the responses so that if pageDetailsFromTab$ emits, that value is used. + // Otherwise, if it doesn't emit in time, the timeout observable emits an empty array. + // Also, pageDetailsFallback$ will emit in error cases. + return merge(sharedPageDetailsFromTab$, pageDetailsFallback$, pageDetailsTimeout$); } /** From 30057fea33a6996c45ec19a89614435d9862a889 Mon Sep 17 00:00:00 2001 From: Jordan Aasen <166539328+jaasen-livefront@users.noreply.github.com> Date: Tue, 18 Mar 2025 09:03:03 -0700 Subject: [PATCH 2/4] [PM-18669] - Moving item to org in desktop app does not update until sync (#13754) * refresh vault item list after sharing cipher * refresh list after save * fix vault sync issue * update autofill a11y * Revert "update autofill a11y" This reverts commit 1a3aa0d0f0d29b3aed6df1c2c6f872f00345afde. --- apps/desktop/src/vault/app/vault/vault.component.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/apps/desktop/src/vault/app/vault/vault.component.ts b/apps/desktop/src/vault/app/vault/vault.component.ts index 2c669e388f8..d8be360170a 100644 --- a/apps/desktop/src/vault/app/vault/vault.component.ts +++ b/apps/desktop/src/vault/app/vault/vault.component.ts @@ -493,12 +493,14 @@ export class VaultComponent implements OnInit, OnDestroy { } async savedCipher(cipher: CipherView) { - this.cipherId = cipher.id; + this.cipherId = null; this.action = "view"; await this.vaultItemsComponent.refresh(); + this.cipherId = cipher.id; await this.cipherService.clearCache(this.activeUserId); - await this.viewComponent.load(); + await this.vaultItemsComponent.load(this.activeFilter.buildFilter()); this.go(); + await this.vaultItemsComponent.refresh(); } async deletedCipher(cipher: CipherView) { @@ -572,6 +574,8 @@ export class VaultComponent implements OnInit, OnDestroy { // eslint-disable-next-line @typescript-eslint/no-floating-promises this.viewCipher(cipher); await this.vaultItemsComponent.refresh(); + await this.cipherService.clearCache(this.activeUserId); + await this.vaultItemsComponent.load(this.activeFilter.buildFilter()); }); // eslint-disable-next-line rxjs-angular/prefer-takeuntil, rxjs/no-async-subscribe this.modal.onClosed.subscribe(async () => { From 70cfd33d9670a4e4f4d16cfd4e237595b9f3e90b Mon Sep 17 00:00:00 2001 From: Jordan Aasen <166539328+jaasen-livefront@users.noreply.github.com> Date: Tue, 18 Mar 2025 09:18:20 -0700 Subject: [PATCH 3/4] Revert "collapse collections initially" (#13845) This reverts commit 2e90a6af12f4e22c83606e8b5cc179d32d27a62c. --- .../components/collection-filter.component.ts | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/libs/angular/src/vault/vault-filter/components/collection-filter.component.ts b/libs/angular/src/vault/vault-filter/components/collection-filter.component.ts index 168afbdd72a..d104026f2f6 100644 --- a/libs/angular/src/vault/vault-filter/components/collection-filter.component.ts +++ b/libs/angular/src/vault/vault-filter/components/collection-filter.component.ts @@ -1,6 +1,6 @@ // FIXME: Update this file to be type safe and remove this and next line // @ts-strict-ignore -import { Directive, EventEmitter, Input, OnInit, Output } from "@angular/core"; +import { Directive, EventEmitter, Input, Output } from "@angular/core"; import { CollectionView } from "@bitwarden/admin-console/common"; import { ITreeNodeObject } from "@bitwarden/common/vault/models/domain/tree-node"; @@ -10,7 +10,7 @@ import { TopLevelTreeNode } from "../models/top-level-tree-node.model"; import { VaultFilter } from "../models/vault-filter.model"; @Directive() -export class CollectionFilterComponent implements OnInit { +export class CollectionFilterComponent { @Input() hide = false; @Input() collapsedFilterNodes: Set; @Input() collectionNodes: DynamicTreeNode; @@ -51,13 +51,4 @@ export class CollectionFilterComponent implements OnInit { async toggleCollapse(node: ITreeNodeObject) { this.onNodeCollapseStateChange.emit(node); } - - ngOnInit() { - // Populate the set with all node IDs so all nodes are collapsed initially. - if (this.collectionNodes?.fullList) { - this.collectionNodes.fullList.forEach((node) => { - this.collapsedFilterNodes.add(node.id); - }); - } - } } From ac127c1512b53e076930f9edeec2eaa453dd771b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 18 Mar 2025 14:23:48 -0400 Subject: [PATCH 4/4] [deps] Vault: Update https-proxy-agent to v7.0.6 (#12301) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- apps/cli/package.json | 2 +- package-lock.json | 73 ++++++++++++++++++++++++++++++++----------- package.json | 2 +- 3 files changed, 56 insertions(+), 21 deletions(-) diff --git a/apps/cli/package.json b/apps/cli/package.json index f8f1c8a02d9..7d9f4af0ffe 100644 --- a/apps/cli/package.json +++ b/apps/cli/package.json @@ -68,7 +68,7 @@ "chalk": "4.1.2", "commander": "11.1.0", "form-data": "4.0.1", - "https-proxy-agent": "7.0.5", + "https-proxy-agent": "7.0.6", "inquirer": "8.2.6", "jsdom": "26.0.0", "jszip": "3.10.1", diff --git a/package-lock.json b/package-lock.json index 023b36afadc..52d525f08a5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -43,7 +43,7 @@ "commander": "11.1.0", "core-js": "3.40.0", "form-data": "4.0.1", - "https-proxy-agent": "7.0.5", + "https-proxy-agent": "7.0.6", "inquirer": "8.2.6", "jquery": "3.7.1", "jsdom": "26.0.0", @@ -204,7 +204,7 @@ "chalk": "4.1.2", "commander": "11.1.0", "form-data": "4.0.1", - "https-proxy-agent": "7.0.5", + "https-proxy-agent": "7.0.6", "inquirer": "8.2.6", "jsdom": "26.0.0", "jszip": "3.10.1", @@ -759,6 +759,16 @@ "@types/send": "*" } }, + "node_modules/@angular-devkit/build-angular/node_modules/agent-base": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.3.tgz", + "integrity": "sha512-jRR5wdylq8CkOe6hei19GGZnxM6rBGwFl3Bg0YItGDimvjGtAvdZk4Pu6Cl4u4Igsws4a1fd1Vq3ezrhn4KmFw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 14" + } + }, "node_modules/@angular-devkit/build-angular/node_modules/babel-loader": { "version": "9.1.3", "resolved": "https://registry.npmjs.org/babel-loader/-/babel-loader-9.1.3.tgz", @@ -880,6 +890,20 @@ "node": ">= 6" } }, + "node_modules/@angular-devkit/build-angular/node_modules/https-proxy-agent": { + "version": "7.0.5", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.5.tgz", + "integrity": "sha512-1e4Wqeblerz+tMKPIq2EMGiiWW1dIjZOksyHWSUm1rmuvw/how9hBHZ38lAGj5ID4Ik6EdkOw7NmWPy6LAwalw==", + "dev": true, + "license": "MIT", + "dependencies": { + "agent-base": "^7.0.2", + "debug": "4" + }, + "engines": { + "node": ">= 14" + } + }, "node_modules/@angular-devkit/build-angular/node_modules/immutable": { "version": "4.3.7", "resolved": "https://registry.npmjs.org/immutable/-/immutable-4.3.7.tgz", @@ -2090,6 +2114,16 @@ "semver": "bin/semver.js" } }, + "node_modules/@angular/build/node_modules/agent-base": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.3.tgz", + "integrity": "sha512-jRR5wdylq8CkOe6hei19GGZnxM6rBGwFl3Bg0YItGDimvjGtAvdZk4Pu6Cl4u4Igsws4a1fd1Vq3ezrhn4KmFw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 14" + } + }, "node_modules/@angular/build/node_modules/chokidar": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", @@ -2135,6 +2169,20 @@ "node": ">= 6" } }, + "node_modules/@angular/build/node_modules/https-proxy-agent": { + "version": "7.0.5", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.5.tgz", + "integrity": "sha512-1e4Wqeblerz+tMKPIq2EMGiiWW1dIjZOksyHWSUm1rmuvw/how9hBHZ38lAGj5ID4Ik6EdkOw7NmWPy6LAwalw==", + "dev": true, + "license": "MIT", + "dependencies": { + "agent-base": "^7.0.2", + "debug": "4" + }, + "engines": { + "node": ">= 14" + } + }, "node_modules/@angular/build/node_modules/immutable": { "version": "4.3.7", "resolved": "https://registry.npmjs.org/immutable/-/immutable-4.3.7.tgz", @@ -21272,12 +21320,12 @@ } }, "node_modules/https-proxy-agent": { - "version": "7.0.5", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.5.tgz", - "integrity": "sha512-1e4Wqeblerz+tMKPIq2EMGiiWW1dIjZOksyHWSUm1rmuvw/how9hBHZ38lAGj5ID4Ik6EdkOw7NmWPy6LAwalw==", + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz", + "integrity": "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==", "license": "MIT", "dependencies": { - "agent-base": "^7.0.2", + "agent-base": "^7.1.2", "debug": "4" }, "engines": { @@ -24154,19 +24202,6 @@ "node": ">= 14" } }, - "node_modules/jsdom/node_modules/https-proxy-agent": { - "version": "7.0.6", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz", - "integrity": "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==", - "license": "MIT", - "dependencies": { - "agent-base": "^7.1.2", - "debug": "4" - }, - "engines": { - "node": ">= 14" - } - }, "node_modules/jsdom/node_modules/tough-cookie": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-5.1.1.tgz", diff --git a/package.json b/package.json index 571ec82fcda..4886fe9a90d 100644 --- a/package.json +++ b/package.json @@ -173,7 +173,7 @@ "commander": "11.1.0", "core-js": "3.40.0", "form-data": "4.0.1", - "https-proxy-agent": "7.0.5", + "https-proxy-agent": "7.0.6", "inquirer": "8.2.6", "jquery": "3.7.1", "jsdom": "26.0.0",