You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running the app on iOS, adding a webFetchExtra property containing an abort controller signal to the argument passed to the downloadFile method causes a DataCloneError exception to be thrown, resulting in the download failing.
Here is the problematic code snippet:
awaitFilesystem.downloadFile({path: path,url: downloadUrl,directory: directory,progress: true,webFetchExtra: { signal },readTimeout: 7000,});
Expected Behavior
The downloadFile method should not throw a DataCloneError. Either:
The argument passed to the downloadFile method should be fully serialized before being pushed to the web worker, or
The webFetchExtra property should be removed entirely before the data is sent to native platforms if it's not used there.
Code Reproduction
Reproduce the issue by using the following code:
constcontroller=newAbortController();constsignal=controller.signal;awaitFilesystem.downloadFile({path: "Download/logo.png",url: "https://upload.wikimedia.org/wikipedia/commons/thumb/8/80/Wikipedia-logo-v2.svg/1200px-Wikipedia-logo-v2.svg.png",directory: Directory.ExternalStorage,webFetchExtra: { signal }});
Other Technical Details
Error: DataCloneError
Cause: The signal object is not serializable but is still pushed to the web worker.
Notes: The error occurs because signal (part of AbortController) cannot be cloned or serialized for transfer between threads.
Additional Context
The downloadFile argument must either be fully serialized or have its webFetchExtra property stripped out before being sent to the native layer.
The text was updated successfully, but these errors were encountered:
This issue needs more information before it can be addressed.
In particular, the reporter needs to provide a minimal sample app that demonstrates the issue.
If no sample app is provided within 15 days, the issue will be closed.
Bug Report
Plugin(s)
@capacitor/filesystem: 6.0.2
Capacitor Version
Platform(s)
Current Behavior
When running the app on iOS, adding a
webFetchExtra
property containing an abort controller signal to the argument passed to thedownloadFile
method causes aDataCloneError
exception to be thrown, resulting in the download failing.Here is the problematic code snippet:
Expected Behavior
The
downloadFile
method should not throw aDataCloneError
. Either:downloadFile
method should be fully serialized before being pushed to the web worker, orwebFetchExtra
property should be removed entirely before the data is sent to native platforms if it's not used there.Code Reproduction
Reproduce the issue by using the following code:
Other Technical Details
DataCloneError
signal
object is not serializable but is still pushed to the web worker.signal
(part ofAbortController
) cannot be cloned or serialized for transfer between threads.Additional Context
The
downloadFile
argument must either be fully serialized or have itswebFetchExtra
property stripped out before being sent to the native layer.The text was updated successfully, but these errors were encountered: