forked from wkh237/react-native-fetch-blob
-
Notifications
You must be signed in to change notification settings - Fork 793
Closed
Description
Dependencies
"react": "16.13.1",
"react-native": "0.63.4",
"rn-fetch-blob": "^0.12.0"Problem
Network task fails to complete in Release mode (iOS) and seem to be blocking here, where self.task becomes nil and [nil resume] is called.
...
self.task = [session dataTaskWithRequest:req];
[self.task resume]; // self.task = nilWorkaround
Avoiding self.task makes the network requests work again, so we suspect a problem around it.
// self.task = [session dataTaskWithRequest:req];
// [self.task resume];
[[session dataTaskWithRequest:req] resume];Proposal
Kindly select an option that works for both of us so a PR can be submitted:
- Avoid using the
self.taskproperty altogether. (probably not possible because it's used on cancelRequest) - Should the task be declared
weak? Declareself.taskasstrong. - Postponing assignment:
NSURLSessionDataTask *task = [session dataTaskWithRequest:req];
[task resume];
self.task = task;Work will be started immediately after response, because this issue is critical to us.
Edit: Submitted option 3 as a PR, cause it looks the least intrusive and would really help.
gaguirre
Metadata
Metadata
Assignees
Labels
No labels