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
I wrapped fetch method with withCheckedThrowingContinuation, but I got a fatal error.
Thread 1: Fatal error: SWIFT TASK CONTINUATION MISUSE: fetch(_:ignoreError:cachePolicy:) tried to resume its continuation more than once, throwing cannotParseResponse!
Fortunately, cannotParseResponse error is used in only one place so I can easily tracked it.
resultHandler was called from below two method.
Version
1.15.1
Steps to reproduce the behavior
I couldn't share the response data because it is private project in company. Sorry about it.
Logs
Anything else?
No response
The text was updated successfully, but these errors were encountered:
The result handler being called multiple times is expected behaviour. In the specific example you provided, internally the URLSessionDataDelegate method urlSession(_ session, dataTask, didReceive) can be called more than once and provides chunks of data as received, so this is then passed through the completionBlock every time new data is received. Separately the error delegate method could be called at anytime during the request if an error is encountered. When handling the response data and result handlers you will want to handle it similar to how you would handle if you were directly implementing these delegate methods which can be called more than once.
There has been some discussion around this and supporting Swift Concurrency, specifically you may be interested in this comment.
Another note is we are currently working on our 2.0 release which will support Swift Concurrency in the library, you can follow along with that here.
Do you have any feedback for the maintainers? Please tell us by taking a one-minute survey. Your responses will help us understand Apollo iOS usage and allow us to serve you better.
Summary
I wrapped
fetch
method withwithCheckedThrowingContinuation
, but I got a fatal error.Fortunately,
cannotParseResponse
error is used in only one place so I can easily tracked it.resultHandler
was called from below two method.Version
1.15.1
Steps to reproduce the behavior
I couldn't share the response data because it is private project in company. Sorry about it.
Logs
Anything else?
No response
The text was updated successfully, but these errors were encountered: