diff --git a/apps/browser/src/vault/popup/components/vault-v2/vault-v2.component.ts b/apps/browser/src/vault/popup/components/vault-v2/vault-v2.component.ts index 30d1d21abfb..dc56452e017 100644 --- a/apps/browser/src/vault/popup/components/vault-v2/vault-v2.component.ts +++ b/apps/browser/src/vault/popup/components/vault-v2/vault-v2.component.ts @@ -143,12 +143,24 @@ export class VaultV2Component implements OnInit, AfterViewInit, OnDestroy { * @protected */ protected loading$ = combineLatest([ - this.vaultPopupLoadingService.loading$, - this.readySubject.asObservable(), + this.vaultPopupLoadingService.loading$ + .pipe(tap((loading) => { + console.log("vault loading service state:", loading); + })), + this.readySubject.asObservable() + .pipe( + tap((ready) => { + console.log("vault ready state:", ready); + }), + ) ]).pipe( + tap(([loading, ready]) => { + console.log("vault loading state:", { loading, ready }); + }), map(([loading, ready]) => loading || !ready), distinctUntilChanged(), tap((loading) => { + console.log("vault loading final state:", loading); const key = loading ? "loadingVault" : "vaultLoaded"; void this.liveAnnouncer.announce(this.i18nService.translate(key), "polite"); }), diff --git a/apps/browser/src/vault/popup/services/vault-popup-items.service.ts b/apps/browser/src/vault/popup/services/vault-popup-items.service.ts index 321d7936806..36af1e8cafc 100644 --- a/apps/browser/src/vault/popup/services/vault-popup-items.service.ts +++ b/apps/browser/src/vault/popup/services/vault-popup-items.service.ts @@ -257,8 +257,16 @@ export class VaultPopupItemsService { * Observable that indicates whether the service is currently loading ciphers. */ loading$: Observable = merge( - this._ciphersLoading$.pipe(map(() => true)), - this.remainingCiphers$.pipe(map(() => false)), + this._ciphersLoading$.pipe( + tap(() => { + console.log("[vault popup items service] ciphers loading started"); + }), + map(() => true)), + this.remainingCiphers$.pipe( + tap(() => { + console.log("[vault popup items service] ciphers loading finished"); + }), + map(() => false)), ).pipe(startWith(true), distinctUntilChanged(), shareReplay({ refCount: false, bufferSize: 1 })); /** Observable that indicates whether there is search text present. diff --git a/apps/browser/src/vault/popup/services/vault-popup-loading.service.ts b/apps/browser/src/vault/popup/services/vault-popup-loading.service.ts index f56f2b8d8ee..ed181e068e4 100644 --- a/apps/browser/src/vault/popup/services/vault-popup-loading.service.ts +++ b/apps/browser/src/vault/popup/services/vault-popup-loading.service.ts @@ -1,5 +1,5 @@ import { inject, Injectable } from "@angular/core"; -import { combineLatest, map, shareReplay, startWith } from "rxjs"; +import { combineLatest, map, shareReplay, startWith,tap } from "rxjs"; import { VaultPopupCopyButtonsService } from "./vault-popup-copy-buttons.service"; import { VaultPopupItemsService } from "./vault-popup-items.service"; @@ -15,12 +15,24 @@ export class VaultPopupLoadingService { /** Loading state of the vault */ loading$ = combineLatest([ - this.vaultPopupItemsService.loading$, - this.vaultPopupListFiltersService.allFilters$, + this.vaultPopupItemsService.loading$ + .pipe(tap(loading => { + console.log("[vault popup loading service] vault popup items loading state:", loading); + })), + this.vaultPopupListFiltersService.allFilters$ + .pipe(tap(loading => { + console.log("[vault popup loading service] vault poupuplist items loading state:", loading); + })), // Added as a dependency to avoid flashing the copyActions on slower devices - this.vaultCopyButtonsService.showQuickCopyActions$, + this.vaultCopyButtonsService.showQuickCopyActions$ + .pipe(tap(loading => { + console.log("[vault popup loading service] vault copy buttons loading state:", loading); + })), ]).pipe( map(([itemsLoading, filters]) => itemsLoading || !filters), + tap(loading => { + console.log("[vault popup loading service] combined vault loading state:", loading); + }), shareReplay({ bufferSize: 1, refCount: true }), startWith(true), ); diff --git a/libs/angular/src/vault/components/vault-items.component.ts b/libs/angular/src/vault/components/vault-items.component.ts index 0254ddabf2b..afa17b18818 100644 --- a/libs/angular/src/vault/components/vault-items.component.ts +++ b/libs/angular/src/vault/components/vault-items.component.ts @@ -12,6 +12,7 @@ import { shareReplay, switchMap, take, +tap, } from "rxjs"; import { Organization } from "@bitwarden/common/admin-console/models/domain/organization"; @@ -116,10 +117,12 @@ export class VaultItemsComponent implements OnDestroy this.deleted = deleted ?? false; this.archived = archived; await this.applyFilter(filter); + console.log("set loaded", { filter, deleted, archived }); this.loaded = true; } async reload(filter: (cipher: C) => boolean = null, deleted = false, archived = false) { + console.log("reload", { filter, deleted, archived }); this.loaded = false; await this.load(filter, deleted, archived); } @@ -182,7 +185,11 @@ export class VaultItemsComponent implements OnDestroy this.restrictedItemTypesService.restricted$, ]), ), + tap(() => { + console.log("VaultItemsComponent: Loading ciphers..."); + }), switchMap(([indexedCiphers, failedCiphers, searchText, filter, userId, restricted]) => { + console.log("VaultItemsComponent: Applying search and filters..."); let allCiphers = (indexedCiphers ?? []) as C[]; const _failedCiphers = failedCiphers ?? []; @@ -191,6 +198,7 @@ export class VaultItemsComponent implements OnDestroy const restrictedTypeFilter = (cipher: CipherViewLike) => !this.restrictedItemTypesService.isCipherRestricted(cipher, restricted); + console.log("VaultItemsComponent: Searching ciphers with text:", searchText); return this.searchService.searchCiphers( userId, searchText, @@ -198,9 +206,13 @@ export class VaultItemsComponent implements OnDestroy allCiphers, ); }), + tap((ciphers) => { + console.log("VaultItemsComponent: Found ciphers:", ciphers); + }), takeUntilDestroyed(), ) .subscribe((ciphers) => { + console.log("loaded", ciphers); this.ciphers = ciphers; this.loaded = true; });