Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
COPY OF: wkh237#636
Respond if I should still make it to 0.10.9 branch.
Hi,
this PR came from crashes we still get (some description):
wcandillon/react-native-img-cache#95
...but evolved.
Whole RNFetchBlobNetwork class actually do two things:
I moved session and requests logic into separate file, now it's more clean what do what.
NSMapTable
seemed to be used incorrectly or just it's (weak) features not used (it seems from logNSLog(@"object released by ARC.");
that it should or was used), anyway, it's now instantiated withNSMapTableWeakMemory
option for objects, so requests will be released, default in NSMapTable is to use strong references.sharedInstance
is used instead tables and dictionaries instances created on load. This pattern is used all around but please give me a feedback why previous is better solution, maybe I missed something.Other things done in this PR when implementing:
checkExpiredSessions
didn’t find anywhere, removed from header+ (void) enableProgressReport:(NSString *) taskId, + (void) enableUploadProgress:(NSString *) taskId, - (void) sendRequest
method declarations removedunused
fileTaskCompletionHandler
anddataTaskCompletionHandler
properties and synthesizers removedI can't find any place where actually something is added to
expirationTable
.Does
HTTPMaximumConnectionsPerHost = 10
have any impact as new session is created for every request (exceptdefaultSessionConfiguration
)? In docs it says that it applies to all sessions'...based on this configuration'
, what actually this means, the same instance, identifier or some comparison???I'm aware of few fixes that are in 0.10.9 not included here.
TODO:
This is WIP, works for now for us, but didn't test everything and any feedback or testing would be great.
POST 16.01.2018
What about applying:
http://google.github.io/styleguide/objcguide.html
I agree with that code guideline mostly.
POST 19.01.2018:
https://github.com/flatfox-ag/react-native-fetch-blob/tree/exception_fixes 2 days already in production, no exceptions yet.
This branch have all these fixes:
wkh237#619
wkh237#499
and all changes from:
https://github.com/flatfox-ag/react-native-fetch-blob/tree/synchronized
DOES NOT HAVE
wkh237:0.11.0
commits listed in this PR!feel free to:
"react-native-fetch-blob": "github:flatfox-ag/react-native-fetch-blob#exception_fixes",
As we use it in production I removed WIP note.
Stuff in TODO will come in different PRs I guess.
POST 25.01.2018
Week without crashes on production, fixes confirmed :)