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

fix: add notification center registry #413

Merged
merged 9 commits into from
Feb 3, 2023

Conversation

andrewleap-optimizely
Copy link
Contributor

@andrewleap-optimizely andrewleap-optimizely commented Jan 19, 2023

Summary

Create a private registry of NotificationCenters for internal use.

  • Remove dependence on user supplied NotificationCenter.
  • Resolve issue of notifications being registered with one NotificationCenter and sent to a different one.

Test plan

added tests to

  • test_notification_center_registry.py
  • test_optimizely.py
  • test_optimizely_config.py
  • test_optimizely_factory.py

Ticket

FSSDK-8773

@andrewleap-optimizely andrewleap-optimizely marked this pull request as ready for review January 27, 2023 00:22
@andrewleap-optimizely andrewleap-optimizely requested a review from a team as a code owner January 27, 2023 00:22
Copy link
Contributor

@jaeopt jaeopt left a comment

Choose a reason for hiding this comment

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

Changes look good. I see a case when sdk_key is not provided. See my comments.

optimizely/config_manager.py Show resolved Hide resolved
if not self.sdk_settings.odp_disabled:
self._update_odp_config_on_datafile_update()
self.odp_manager: OdpManager
self.setup_odp(sdk_key or self.config_manager.get_sdk_key())
Copy link
Contributor

Choose a reason for hiding this comment

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

I see 2 changes related to "sdk_key" in here and in config_manager, both optional.
If none of them required, then we may have a case sdk_key is null.
As noted in my comment in config_manager, we may not need get_sdk_key in config_manager.
We can consider "sdk_key" in optimizely from optional to required while removing the changes in config_manager.

Copy link
Contributor

@Mat001 Mat001 left a comment

Choose a reason for hiding this comment

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

Looks ok. One typo

tests/test_notification_center_registry.py Outdated Show resolved Hide resolved
Copy link
Contributor

@jaeopt jaeopt left a comment

Choose a reason for hiding this comment

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

LGTM

@jaeopt
Copy link
Contributor

jaeopt commented Feb 3, 2023

@andrewleap-optimizely can we keep a note about this breaking change. We should release a major version bump with this note.

@andrewleap-optimizely andrewleap-optimizely merged commit 3fe4935 into master Feb 3, 2023
@andrewleap-optimizely andrewleap-optimizely deleted the aleap/add_notification_registry branch February 3, 2023 21:56
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

3 participants