Skip to content

[FSSDK-10090] Refactor ODP integration - #920

Merged
Mike Chu (mikechu-optimizely) merged 24 commits into
masterfrom
raju/odp_refac
Apr 5, 2024
Merged

Mike Chu (mikechu-optimizely) merged 24 commits into
masterfrom
raju/odp_refac

Conversation

@raju-opti

@raju-opti Raju Ahmed (raju-opti) commented Apr 2, 2024 •

Copy link
Copy Markdown
Contributor

Summary

Things fixed:

  • ODPManager should not be running and scheduling timer if ODP is not integrated to the project (which causes memory leak if one sdk instance is created per request)
  • CreateUserContext should work even when called before the datafile is downloaded and should send the identify ODP events after datafile download completes
  • Other automatic odp events (vuid registration, client initialized) should also be sent after datafile is available and should not be dropped if batching is disabled.
  • ODP manager should distinguish between when odp config is still not loaded and when odp is not integrated at all
  • made ODP config immutable
  • ODP event manager should not schedule timers to flush events if event batching is disabled (ie batch size == 1)
  • other code quality improvements

Test plan

  • added new tests where applicable, and updated old tests

Issues

  • FSSDK-10090

Comment thread lib/core/odp/odp_event_manager.ts
Comment thread lib/core/odp/odp_manager.ts Outdated
Comment thread lib/core/odp/odp_segment_manager.ts Outdated
@coveralls

Coveralls (coveralls) commented Apr 4, 2024 •

Copy link
Copy Markdown

Coverage Status

coverage: 90.313% (-0.07%) from 90.381%
when pulling 117a4b5 on raju/odp_refac
into 53a2042 on master.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

That was a long one phew. Thanks for putting all your thoughts in.

👇 are just some non-show stopping, thoughts/suggestions.

Comment thread lib/core/odp/odp_config.ts
Comment thread lib/core/odp/odp_config.ts Outdated
Comment thread lib/core/odp/odp_event_api_manager.ts
Comment thread lib/core/odp/odp_event_manager.ts
Comment thread lib/core/odp/odp_event_manager.ts Outdated
Comment thread lib/core/odp/odp_event_manager.ts
Comment thread lib/core/odp/odp_manager.ts
Comment thread lib/core/project_config/project_config_manager.tests.js
Comment thread lib/optimizely/index.ts
Comment thread tests/odpManager.spec.ts Outdated

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@jaeopt Jae Kim (jaeopt) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

One clarification - I see the updateOdpConfig on config change is broken. Can you take a look?

Comment thread lib/core/odp/odp_event_manager.ts Outdated
Comment thread lib/core/odp/odp_event_manager.ts Outdated
Comment thread lib/core/odp/odp_event_manager.ts
Comment thread lib/core/odp/odp_event_manager.ts
Comment thread lib/optimizely/index.ts

@jaeopt Jae Kim (jaeopt) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@mikechu-optimizely
Mike Chu (mikechu-optimizely) deleted the raju/odp_refac branch April 5, 2024 21:44
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.

5 participants