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

added other AV task exceptions in NSURLSession instrumentation #640

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

bryce-b
Copy link
Member

@bryce-b bryce-b commented Nov 21, 2024

There are additional AV download tasks that need to be accounted for.
Related issues : elastic/apm-agent-ios#242

if let avAssetTaskClass = Self.avAssetDownloadTask,
task.isKind(of: avAssetTaskClass) {
return
for aClass in Self.AVTaskClassList {
Copy link
Contributor

Choose a reason for hiding this comment

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

contains(where:) would be more idiomatic.

guard !Self.AVTaskClassList.contains(where: { task.isKind(of: $0) }) else { return }


static let AVTaskClassList : [AnyClass] = {
let names = ["__NSCFBackgroundAVAggregateAssetDownloadTask", "__NSCFBackgroundAVAssetDownloadTask", "__NSCFBackgroundAVAggregateAssetDownloadTaskNoChildTask" ]
var classes : [AnyClass] = []
Copy link
Contributor

Choose a reason for hiding this comment

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

let classes = names.compactMap { NSClassFromString($0) }
return classes

@bryce-b bryce-b force-pushed the session-instrumentation-AV-fix branch from eda5b4d to b799e43 Compare November 21, 2024 17:33
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.

3 participants