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

Fatal error: couldn't found taskProvider #91

Open
carlmachaalani opened this issue Jul 31, 2024 · 0 comments
Open

Fatal error: couldn't found taskProvider #91

carlmachaalani opened this issue Jul 31, 2024 · 0 comments

Comments

@carlmachaalani
Copy link

carlmachaalani commented Jul 31, 2024

Hi,

I regularly get this error when calling the stream function in the urlSession in NetworkSessionDelegate file. resetting the audio stream with a queue of new URLs. It does happen randomly, so I'm not quite sure where the source is from. The error gets thrown in the NetworkSessionDelegate file:

final class NetworkSessionDelegate: NSObject, URLSessionDataDelegate {
    weak var taskProvider: StreamTaskProvider?

    func stream(for task: URLSessionTask) -> NetworkDataStream? {
        guard let taskProvider = taskProvider else {
            assertionFailure("couldn't found taskProvider")
            return nil
        }
        return taskProvider.dataStream(for: task)
    }

    func urlSession(_: URLSession,
                    dataTask: URLSessionDataTask,
                    didReceive data: Data)
    {
        guard let stream = stream(for: dataTask) else {
            return
        }
        stream.didReceive(data: data,
                          response: dataTask.response as? HTTPURLResponse)
    }
    ....
}

Logs when the error happens:

>> engine stopped 🛑
Setting current reading entry to: (
    "[AudioEntry: AudioEntryId(unique: 42E8C754-B4F9-4665-A3FA-90C48F424E64, id: \"https://my-audio...")]"
)
engine started 🛵
AudioStreaming/NetworkSessionDelegate.swift:13: Fatal error: couldn't found taskProvider

I'll try to add in more context once I have more clues. Thanks!

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

No branches or pull requests

1 participant