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-7400] Fixed issue with clearing search index state #8686

Merged
merged 7 commits into from
Apr 11, 2024

Conversation

gbubemismith
Copy link
Member

Type of change

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

Objective

Code changes

  • file.ext: Description of what was changed and why

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

@github-actions github-actions bot added the needs-qa Marks a PR as requiring QA approval label Apr 11, 2024
@gbubemismith gbubemismith marked this pull request as draft April 11, 2024 00:32
Copy link

codecov bot commented Apr 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 27.20%. Comparing base (16c289d) to head (dddeb93).
Report is 2 commits behind head on main.

❗ Current head dddeb93 differs from pull request most recent head fa810ee. Consider uploading reports for the commit fa810ee to get more accurate results

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #8686   +/-   ##
=======================================
  Coverage   27.20%   27.20%           
=======================================
  Files        2339     2339           
  Lines       68267    68263    -4     
  Branches    12749    12748    -1     
=======================================
  Hits        18570    18570           
+ Misses      48301    48297    -4     
  Partials     1396     1396           

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

@gbubemismith gbubemismith marked this pull request as ready for review April 11, 2024 00:49
Copy link
Contributor

github-actions bot commented Apr 11, 2024

Logo
Checkmarx One – Scan Summary & Detailsb7d73cce-e78d-43c4-bb59-814d0e67c962

No New Or Fixed Issues Found

* Fix flashing banner for users who shouldn't see it

* Emit the right value the first time

* simplify further

* restore comment
Copy link
Member

@justindbaur justindbaur left a comment

Choose a reason for hiding this comment

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

Is is possible to just add the "logout" option to the user key definitions of all the state being cleared inside of clearIndex? That would take care of making sure the state for the correct user is being cleared. As this currently stands, it will clear the state for the currently active user even if a user that isn't currently active is in the process of being logged out.

Copy link
Member

@justindbaur justindbaur left a comment

Choose a reason for hiding this comment

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

Now that you've got the clearing setup through the UserKeyDefinition I think you can delete that method altogether, both the call sites and the definition.

@@ -1171,6 +1171,7 @@ export default class MainBackground {
this.vaultTimeoutSettingsService.clear(userId),
this.vaultFilterService.clear(),
this.biometricStateService.logout(userId),
this.searchService.clearIndex(),
Copy link
Member

Choose a reason for hiding this comment

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

I think you can safely remove this now that you have the option defined in clearOn.

@@ -587,6 +587,7 @@ export class AppComponent implements OnInit, OnDestroy {
await this.passwordGenerationService.clear(userBeingLoggedOut);
await this.vaultTimeoutSettingsService.clear(userBeingLoggedOut);
await this.biometricStateService.logout(userBeingLoggedOut as UserId);
await this.searchService.clearIndex();
Copy link
Member

Choose a reason for hiding this comment

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

This one too.

@gbubemismith gbubemismith removed the needs-qa Marks a PR as requiring QA approval label Apr 11, 2024
@gbubemismith gbubemismith merged commit c2b91d2 into main Apr 11, 2024
51 checks passed
@gbubemismith gbubemismith deleted the vault/PM-7400 branch April 11, 2024 16:53
@gbubemismith gbubemismith changed the title [PM-4700] Fixed issue with clearing search index state [PM-7400] Fixed issue with clearing search index state Apr 11, 2024
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.

None yet

4 participants