Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PM-12045] search service activeuserstate #13035

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

Jingo88
Copy link
Contributor

@Jingo88 Jingo88 commented Jan 23, 2025

🎟️ Tracking

PM-12045

📔 Objective

Remove ActiveUserState from search service

📸 Screenshots

⏰ Reminders before review

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Protected functional changes with optionality (feature flags)
  • Used internationalization (i18n) for all UI strings
  • CI builds passed
  • Communicated to DevOps any deployment requirements
  • Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team

🦮 Reviewer guidelines

  • 👍 (:+1:) or similar for great changes
  • 📝 (:memo:) or ℹ️ (:information_source:) for notes or general info
  • ❓ (:question:) for questions
  • 🤔 (:thinking:) or 💭 (:thought_balloon:) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion
  • 🎨 (:art:) for suggestions / improvements
  • ❌ (:x:) or ⚠️ (:warning:) for more significant problems or concerns needing attention
  • 🌱 (:seedling:) or ♻️ (:recycle:) for future improvements or indications of technical debt
  • ⛏ (:pick:) for minor or nitpick changes

@Jingo88 Jingo88 requested review from a team as code owners January 23, 2025 19:25
Copy link
Contributor

github-actions bot commented Jan 23, 2025

Logo
Checkmarx One – Scan Summary & Details84e7df6a-e30e-48d6-8d75-2e729cbcbc49

Great job, no security vulnerabilities found in this Pull Request

Copy link

codecov bot commented Jan 23, 2025

Codecov Report

Attention: Patch coverage is 16.66667% with 55 lines in your changes missing coverage. Please review.

Project coverage is 35.19%. Comparing base (3f05a5e) to head (77adfc7).
Report is 2 commits behind head on main.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
libs/common/src/services/search.service.ts 0.00% 26 Missing ⚠️
...pps/web/src/app/vault/org-vault/vault.component.ts 0.00% 5 Missing ⚠️
...ular/src/vault/components/vault-items.component.ts 0.00% 5 Missing ⚠️
libs/common/src/vault/services/cipher.service.ts 0.00% 5 Missing ⚠️
libs/angular/src/tools/send/send.component.ts 0.00% 4 Missing ⚠️
.../src/app/vault/individual-vault/vault.component.ts 0.00% 3 Missing ⚠️
...rowser/src/autofill/popup/fido2/fido2.component.ts 0.00% 2 Missing ⚠️
...sktop/src/vault/app/vault/vault-items.component.ts 0.00% 2 Missing ⚠️
apps/desktop/src/app/tools/send/send.component.ts 0.00% 1 Missing ⚠️
apps/web/src/app/app.component.ts 0.00% 1 Missing ⚠️
... and 1 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #13035      +/-   ##
==========================================
+ Coverage   35.10%   35.19%   +0.08%     
==========================================
  Files        3000     2998       -2     
  Lines       91320    91107     -213     
  Branches    17094    17046      -48     
==========================================
+ Hits        32062    32069       +7     
+ Misses      56754    56533     -221     
- Partials     2504     2505       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

private isSearching$ = combineLatest([
this.searchControl.valueChanges,
this.accountService.activeAccount$.pipe(
map((a) => a?.id),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use the helper rjxs operators for this: https://github.com/bitwarden/clients/blob/main/libs/common/src/auth/services/account.service.ts#L51-L67.

I suggest that you use getUserId which requires a UserId, then you don't have to filter out nulls in the next line.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh did not know this was there. This is awesome. thanks!

Copy link
Member

@eliykat eliykat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On second thoughts, both the AC components can just be deleted. However the rxjs helper operator may still be useful for the other classes affected by this PR.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file is unused and can be deleted. It looks like it was missed in a previous feature flag cleanup.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file is unused and can be deleted. It looks like it was missed in a previous feature flag cleanup.

@Jingo88 Jingo88 requested a review from eliykat January 24, 2025 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants