-
Notifications
You must be signed in to change notification settings - Fork 50
Description
Task description
Currently InstrumentedExtension is used to capture events sent through the EventHub using a wildcard event handler, but this has downsides:
- Impacts extension registration process
- Processing time/operations to register this extension
- EventHub shared state event for the InstrumentedExtension
- No easy way to get a reference to the extension instance itself
These can be addressed by replacing this implementation in TestBase with a wildcard listener registered with MobileCore:
public typealias EventListener = (Event) -> Void
MobileCore.registerEventListener(type: EventType.wildcard, source: EventSource.wildcard, listener: EventCollector)Where EventCollector (name not set in stone) is an implementation of the EventListener type
Breaking change
Note that removing InstrumentedExtension will be a breaking change of two categories:
- Direct usage
- Indirect extension startup event expectations (vast majority of usage cases)
Direct usage
IdentityIntegrationTests.swift:
| MobileCore.unregisterExtension(InstrumentedExtension.self) { |
- Fix: direct usage just needs to be removed, since TestBase will handle the (un)registration of the new wildcard listener
NetworkResponseHandlerFunctionalTests.swift: https://github.com/adobe/aepsdk-edge-ios/blob/726f7b158a80fea0b827ceca5ddc9e71932689bf/Tests/FunctionalTests/NetworkResponseHandlerFunctionalTests.swift#L33
- This actually is not required even today, since TestBase already registers this extension in its per-test-case setup code
- Fix: remove InstrumentedExtension from this list
Indirect extension startup event expectations
Once removed, these test cases will need to reduce their expected event counts to account for the removal of the InstrumentedExtension.
Usage search: https://github.com/search?q=org%3Aadobe+InstrumentedExtension&type=code&p=1
Addresses the deprecation in: #1084
Additional implementation details or code snippet(s)
No response