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

refactor: streamline softLock logic #16536

Merged
merged 2 commits into from
Jan 17, 2024
Merged

refactor: streamline softLock logic #16536

merged 2 commits into from
Jan 17, 2024

Conversation

atomrc
Copy link
Contributor

@atomrc atomrc commented Jan 17, 2024

Description

This harmonises the way we compute if we should enable soft lock or not.

This changes the following parts:

  • harmonising the enrollmentSuccess and identityUpate events to be a single event that always sends the config and identity
  • add early return to the logic that computes the soft lock situation

Checklist

  • PR has been self reviewed by the author;
  • Hard-to-understand areas of the code have been commented;
  • If it is a core feature, unit tests have been added;

Comment on lines -62 to -76
useEffect(() => {
if (e2eiEnabled) {
void checkIfIsFreshMLSSelfClient();
}
}, [e2eiEnabled]);

useEffect(() => {
if (!freshMLSSelfClient) {
return () => {};
}
E2EIHandler.getInstance().on('enrollmentSuccessful', checkIfIsFreshMLSSelfClient);
return () => {
E2EIHandler.getInstance().off('enrollmentSuccessful', checkIfIsFreshMLSSelfClient);
};
}, [freshMLSSelfClient]);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This logic has been factored in the handling of the identityUpdate event

Copy link

codecov bot commented Jan 17, 2024

Codecov Report

Attention: 53 lines in your changes are missing coverage. Please review.

Comparison is base (2378bea) 45.42% compared to head (21cb412) 45.38%.
Report is 1 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev   #16536      +/-   ##
==========================================
- Coverage   45.42%   45.38%   -0.04%     
==========================================
  Files         740      740              
  Lines       24218    24258      +40     
  Branches     5504     5518      +14     
==========================================
+ Hits        11000    11009       +9     
- Misses      11806    11829      +23     
- Partials     1412     1420       +8     

@atomrc atomrc merged commit 40a1774 into dev Jan 17, 2024
10 checks passed
@atomrc atomrc deleted the fix/soft-lock branch January 17, 2024 09:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants