-
Notifications
You must be signed in to change notification settings - Fork 1.6k
[iOS] Synchronized tables, separated requests and network logic and other... #636
base: 0.11.0
Are you sure you want to change the base?
Conversation
… sending multiple requests in the same time
createJSModules was removedin React Native 0.47.0 and results in the attached Build Error. removing @OverRide fixes build (didn't remove function because I don't know if it should be kept for downard compatability?) ``` node_modules/react-native-fetch-blob/android/src/main/java/com/RNFetchBlob/RNFetchBlobPackage.java:23: error: method does not override or implement a method from a supertype @OverRide ^ 1 error Incremental compilation of 1 classes completed in 0.219 secs. :react-native-fetch-blob:compileReleaseJavaWithJavac FAILED FAILURE: Build failed with an exception. ```
I added it at the end of the day quickly, fixing sharedInstance access now. |
What about applying: |
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: and all changes from: DOES NOT HAVE feel free to: As we use it in production I removed WIP note. |
Week without crashes on production, fixes confirmed :) |
FYI react-native-fetch-blob has a new maintained location. Check out the README. Please consider submitting your PR there, this repository is unmaintained. |
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.