Skip to content

Conversation

@andrewleap-optimizely
Copy link
Contributor

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

  • notification_center_registry_spec.rb
  • project_spec.rb
  • http_project_config_manager_spec.rb
  • optimizely_factory_spec.rb

Ticket

FSSDK-8775

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

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.

lgtm
couple of comments

@sdk_settings.odp_segments_cache ||= LRUCache.new(
@sdk_settings.segments_cache_size,
@sdk_settings.segments_cache_timeout_in_secs
if !@sdk_settings.odp_disabled && @sdk_settings.odp_segment_manager.nil?
Copy link
Contributor

Choose a reason for hiding this comment

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

I think I'd suggest commenting this same as you did in Py:
"no need to instantiate a cache if a custom cache or segment manager is provided."


CONFIG_DICT_WITH_INTEGRATIONS_JSON = JSON.dump(CONFIG_DICT_WITH_INTEGRATIONS)

def self.deep_clone(obj)
Copy link
Contributor

Choose a reason for hiding this comment

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

What is the purpose of cloning, is it an equivalent of python's deepcpy?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's exactly right. Allowing us to manually modify the datafiles in one test without effecting other tests.

@andrewleap-optimizely andrewleap-optimizely merged commit 05ebb60 into master Feb 9, 2023
@andrewleap-optimizely andrewleap-optimizely deleted the aleap/add_notification_center_registry branch February 9, 2023 17:30
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.

4 participants