nativescript-community / nativescript-community/https
iOS StateProvider crash
Open
Nobody has claimed this yet.
- Dominant language
- Vue
- Stars
- 52
- Forks
- 40
- PR merge metrics
- No merged PRs in 30d
Description
Doing Https.request, got error:
Alamofire/SessionDelegate.swift:49: Fatal error: StateProvider is nil for task 1.
Relevant Stack:
#4 0x00000001a28e5b54 in assertionFailure ()
#5 0x000000010610bc2c in SessionDelegate.request<Alamofire.DataRequest>(for:as:) at /Users/chris/Projects/Mantis/mantis_laser_trainer_app/platforms/ios/Pods/Alamofire/Source/Core/SessionDelegate.swift:49
#6 0x000000010610f40c in SessionDelegate.urlSession(_:dataTask:didReceive:) at /Users/chris/Projects/Mantis/mantis_laser_trainer_app/platforms/ios/Pods/Alamofire/Source/Core/SessionDelegate.swift:254
Code:
func request<R: Request>(for task: URLSessionTask, as type: R.Type) -> R? {
guard let provider = stateProvider else {
assertionFailure("StateProvider is nil for task \(task.taskIdentifier).")
return nil
}
return provider.request(for: task) as? R
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the Https.request failure and tracing the lifecycle around Alamofire's platforms/ios/Pods/Alamofire/Source/Core/SessionDelegate.swift, especially lines 49 and 254. Determine why stateProvider is nil when the data-task callback runs; done means the crash is resolved for this request path and the failure is covered by an appropriate regression check.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ios, swift
- Domain
- mobile-dev, networking
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100