Skip to content

Filter out AnalyticsBase and AnalyticsAppExtension classes from initialize API#1125

Merged
kevinlind merged 1 commit intoadobe:dev-v5.4.1from
kevinlind:initialize-filter
Apr 18, 2025
Merged

Filter out AnalyticsBase and AnalyticsAppExtension classes from initialize API#1125
kevinlind merged 1 commit intoadobe:dev-v5.4.1from
kevinlind:initialize-filter

Conversation

@kevinlind
Copy link
Copy Markdown
Contributor

Include 'AnalyticsBase.Type' and 'AnalyticsAppExtension.Type' to list of extensions filtered out when using initialize API.

The Analytics extension defines a base class AnalyticsBase which adopts Extension plus two subclasses of AnalyticsBase, Analytics and AnalyticsAppExtension. The initialize API would find and register all three of these classes to the SDK tripling the count of each tracking event. The fix is to filter out these extensions so only the Analytics class is registered. The initialize API is not supported in app extensions, so customers building app extensions with Analytics would need to use the registerExtensions API anyway.

See: Jira MOB-23276

Description

Related Issue

Motivation and Context

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have signed the Adobe Open Source CLA.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

… of extensions filtered out when using initialize API.

The Analytics extension defines a base class AnalyticsBase which adopts Extension plus two subclasses of AnalyticsBase, Analytics and AnalyticsAppExtension. The initialize API would find and register all three of these classes to the SDK tripling the count of each tracking event. The fix is to filter out these extensions so only the Analytics class is registered. The initialize API is not supported in app extensions, so customers building app extensions with Analytics would need to use the registerExtensions API anyway.
@kevinlind kevinlind added the bug Something isn't working. Used by issue templates label Apr 17, 2025
@kevinlind kevinlind requested a review from cdhoffmann April 17, 2025 23:28
@kevinlind kevinlind merged commit 098bbc5 into adobe:dev-v5.4.1 Apr 18, 2025
17 checks passed
@kevinlind kevinlind deleted the initialize-filter branch April 18, 2025 17:03
kevinlind added a commit that referenced this pull request May 9, 2025
Filter out AnalyticsBase and AnalyticsAppExtension classes from initialize API
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working. Used by issue templates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants