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-6404] Initial Clear Events Code #8029

Merged
merged 22 commits into from
Feb 27, 2024
Merged

Conversation

justindbaur
Copy link
Member

@justindbaur justindbaur commented Feb 21, 2024

Type of change

- [ ] Bug fix
- [x] New feature development
- [ ] Tech debt (refactoring, code cleanup, dependency upgrades, etc)
- [ ] Build/deploy pipeline (DevOps)
- [ ] Other

Objective

Add a clearOn key definition option so users can choose to have their state cleared on certain events. The option is not currently respected but will be in a follow up PR. This also scaffolds out the services that will be used to make this option work.

Code changes

  • apps/browser/src/platform/background/service-factories/*.factory.ts: Factories for new services
  • apps/web/src/app/platform/web-storage-service.provider.ts: Web override of storage service provider. This will make it possible to delete the web overrides of all the state providers.
  • libs/common/spec/fake-state.ts: Make global state update behave like the other fake state update methods.
  • libs/common/src/platform/services/storage-service.provider.ts: Default implementation of the storage service provider.
  • libs/common/src/platform/state/index.ts: Export the runner only since that is expected to be used by other services.
  • libs/common/src/platform/state/key-definition.ts: New optional key definition option and it's computed brethren on KeyDefinition.
  • libs/common/src/platform/state/state-event-registrar.service.ts: A service for registering a key definition for all its clear events. This is meant to be used internally by SingleUserStateProvider and ActiveUserStateProvider.
  • libs/common/src/platform/state/state-event-runner.service.ts: A service for running an event and clearing the state for all registered events.

Screenshots

Before you submit

  • Please add unit tests where it makes sense to do so (encouraged but not required)
  • If this change requires a documentation update - notify the documentation team
  • If this change has particular deployment requirements - notify the DevOps team
  • Ensure that all UI additions follow WCAG AA requirements

@justindbaur justindbaur requested a review from a team as a code owner February 21, 2024 19:26
@github-actions github-actions bot added the needs-qa Marks a PR as requiring QA approval label Feb 21, 2024
Copy link

codecov bot commented Feb 21, 2024

Codecov Report

Attention: Patch coverage is 66.66667% with 26 lines in your changes are missing coverage. Please review.

Project coverage is 24.76%. Comparing base (4733f45) to head (9d9704a).
Report is 5 commits behind head on main.

Files Patch % Lines
...factories/state-event-registrar-service.factory.ts 0.00% 8 Missing ⚠️
...vice-factories/storage-service-provider.factory.ts 0.00% 7 Missing ⚠️
...n/src/platform/state/state-event-runner.service.ts 73.07% 7 Missing ⚠️
.../src/platform/services/storage-service.provider.ts 71.42% 1 Missing and 1 partial ⚠️
...rc/platform/state/state-event-registrar.service.ts 90.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8029      +/-   ##
==========================================
+ Coverage   24.71%   24.76%   +0.04%     
==========================================
  Files        2224     2230       +6     
  Lines       65381    65459      +78     
  Branches    12357    12367      +10     
==========================================
+ Hits        16158    16210      +52     
- Misses      47898    47923      +25     
- Partials     1325     1326       +1     

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

@bitwarden-bot
Copy link

bitwarden-bot commented Feb 21, 2024

Logo
Checkmarx One – Scan Summary & Detailsca8cf92e-c187-4807-b9f6-51d212febd5f

Fixed Issues

Severity Issue Source File / Package
LOW Use_Of_Hardcoded_Password /apps/cli/src/vault/models/cipher.response.ts: 21
LOW Use_Of_Hardcoded_Password /apps/cli/src/vault/models/cipher.response.ts: 21

@justindbaur justindbaur changed the base branch from main to ps/pm-6404/add-user-key-definition February 22, 2024 18:37
Base automatically changed from ps/pm-6404/add-user-key-definition to main February 26, 2024 16:28
Copy link
Member

@MGibson1 MGibson1 left a comment

Choose a reason for hiding this comment

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

looking great!

@justindbaur justindbaur enabled auto-merge (squash) February 27, 2024 21:57
@justindbaur justindbaur removed the needs-qa Marks a PR as requiring QA approval label Feb 27, 2024
@justindbaur justindbaur merged commit 87c75e5 into main Feb 27, 2024
60 of 61 checks passed
@justindbaur justindbaur deleted the pm/ps-6404/add-clear-events branch February 27, 2024 21:58
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