Nocilla icon indicating copy to clipboard operation
Nocilla copied to clipboard

ASIHTTPRequest synchronous request with stub never ends

Open yuriy-tolstoguzov opened this issue 9 years ago • 1 comments

I don't know is it still in your list of priorities, but I found out that your library does not want to work with ASIHTTPRequest correctly. My AFNetworking requests finished successfully, but ASIHTTPRequest request that starts synchronously never leaves this loop (ASIHTTPRequest:765, method -startSynchronous):

if (![self isCancelled] && ![self complete]) {
    [self main];
    while (!complete) {
        [[NSRunLoop currentRunLoop] runMode:[self runLoopMode] beforeDate:[NSDate distantFuture]];
    }
}

After Nocilla calls -requestFinished this local variable (complete) stays the same.

yuriy-tolstoguzov avatar Jan 26 '16 12:01 yuriy-tolstoguzov

[NSDate distantFuture] is going to cause this code to wait indefinitely and never check your complete variable. Change this to something like [NSDate dateWithTimeIntervalSinceNow:1.0] and see if that helps.

If you still see issues, provide sample code so that we can test/reproduce ourselves and look into it.

andrewkboyd avatar May 18 '16 03:05 andrewkboyd