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

RNFS.downloadFile Broken #3

Closed
alessandro-bottamedi opened this issue Aug 12, 2023 · 3 comments
Closed

RNFS.downloadFile Broken #3

alessandro-bottamedi opened this issue Aug 12, 2023 · 3 comments
Labels
P2 Important issue. Ready Ready for release.

Comments

@alessandro-bottamedi
Copy link

alessandro-bottamedi commented Aug 12, 2023

When I try to download a file here its the result:

Platform: iOS
Package Version: 2.21.0-alpha.2

Exception '+[RCTCxxConvert JS_NativeReactNativeFs_NativeDownloadFileOptions:]: unrecognized selector sent to class 0x10562b6b8' was thrown while invoking downloadFile on target ReactNativeFs with params (
        {
        background = 0;
        backgroundTimeout = 3600000;
        cacheable = 0;
        connectionTimeout = 5000;
        discretionary = 0;
        fromUrl = "XXXXX";
        hasBeginCallback = 0;
        hasProgressCallback = 0;
        hasResumableCallback = 0;
        headers =         {
        };
        jobId = 1;
        progressDivider = 0;
        progressInterval = 0;
        readTimeout = 15000;
        toFile = "XXXXX";
    },
    2982,
    2983
)
callstack: (
	0   CoreFoundation                      0x0000000180437330 __exceptionPreprocess + 172
	1   libobjc.A.dylib                     0x0000000180051274 objc_exception_throw + 56
	2   CoreFoundation                      0x0000000180445d3c __CFExceptionProem + 0
	3   CoreFoundation                      0x000000018043b224 ___forwarding___ + 1308
	4   CoreFoundation                      0x000000018043d50c _CF_forwarding_prep_0 + 92
	5   MowiBike                            0x00000001048c5684 __41-[RCTModuleMethod processMethodSignature]_block_invoke.83 + 140
	6   MowiBike                            0x00000001048c57f8 __41-[RCTModuleMethod processMethodSignature]_block_invoke.96 + 120
	7   MowiBike                            0x00000001048c68f0 -[RCTModuleMethod invokeWithBridge:module:arguments:] + 1460
	8   MowiBike                            0x00000001048ca9a8 _ZN8facebook5reactL11invokeInnerEP9RCTBridgeP13RCTModuleDatajRKN5folly7dynamicEiN12_GLOBAL__N_117SchedulingContextE + 1688
	9   MowiBike                            0x00000001048ca144 _ZZN8facebook5react15RCTNativeModule6invokeEjON5folly7dynamicEiENK3$_0clEv + 128
	10  MowiBike                            0x00000001048ca0b8 ___ZN8facebook5react15RCTNativeModule6invokeEjON5folly7dynamicEi_block_invoke + 28
	11  libdispatch.dylib                   0x0000000180132ee4 _dispatch_call_block_and_release + 24
	12  libdispatch.dylib                   0x0000000180134708 _dispatch_client_callout + 16
	13  libdispatch.dylib                   0x000000018013c77c _dispatch_lane_serial_drain + 776
	14  libdispatch.dylib                   0x000000018013d3dc _dispatch_lane_invoke + 392
	15  libdispatch.dylib                   0x0000000180149608 _dispatch_workloop_worker_thread + 768
	16  libsystem_pthread.dylib             0x00000001b1834878 _pthread_wqthread + 284
	17  libsystem_pthread.dylib             0x00000001b183363c start_wqthread + 8
)

RCTFatal
facebook::react::invokeInner(RCTBridge*, RCTModuleData*, unsigned int, folly::dynamic const&, int, (anonymous namespace)::SchedulingContext)
facebook::react::RCTNativeModule::invoke(unsigned int, folly::dynamic&&, int)::$_0::operator()() const
invocation function for block in facebook::react::RCTNativeModule::invoke(unsigned int, folly::dynamic&&, int)
_dispatch_call_block_and_release
_dispatch_client_callout
_dispatch_lane_serial_drain
_dispatch_lane_invoke
_dispatch_workloop_worker_thread
_pthread_wqthread
start_wqthread
@birdofpreyru
Copy link
Owner

Yeah... as I wrote, it will take a bunch more work, to ensure every function is correctly re-wired; and my current plan is to go over all regular filesystem access functions first, and keep the download / upload functionality to the last. You may check Releases Page regarding the list of functions currently verified to work, as of alpha.2 these are just these: copyFileAssets(), exists(), existsAssets(), mkdir(), readDirAssets(), readFile(), readFileAssets().

@birdofpreyru birdofpreyru added the P2 Important issue. label Aug 12, 2023
@birdofpreyru
Copy link
Owner

also unlink(), writeFile().

@birdofpreyru birdofpreyru added the In Progress Work in progress. label Sep 27, 2023
@birdofpreyru birdofpreyru added Ready Ready for release. and removed In Progress Work in progress. labels Oct 8, 2023
@birdofpreyru
Copy link
Owner

Presumably, downloadFile() works in v2.21.0-alpha.4. Though, I have tested its basic functionality only, thus no guarantees that all its options work correctly, neither that other related functions for download management work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 Important issue. Ready Ready for release.
Projects
None yet
Development

No branches or pull requests

2 participants