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

Merged
merged 5 commits into from
Nov 22, 2024

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
@nachoBonafonte nachoBonafonte merged commit 9332fec into main Nov 22, 2024
11 checks passed
@nachoBonafonte nachoBonafonte deleted the session-instrumentation-AV-fix branch November 22, 2024 13:42
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