Closed fatuhoku closed 10 years ago
The code looks legit. I've never used -waitUntilCompleted:
. I'll have to check it out before I can comment.
a total of two objects passed in
What do you mean by this?
Oh, all I meant was:
NSArray *objects = @[o1, o2]; // o1 and o2 are both PFObjects
[[PFObject rac_deleteAll:objects] waitUntilCompleted:nil];
I wanted to clarify that because conceivably passing in 135913904732 objects might conceivably cause the hang ;)
Can you set a breakpoint inside the block defined within PFRACBooleanCallback
, and see if it's being called?
My first thoughts are:
-rac_deleteAll:
isn't being called-waitUntilCompleted:
On the subject of number 2, why are you using -waitUntilCompleted:
? It's intended to be more for testing. Why won't simply using -subscribeCompleted:
work for you?
I put a breakpoint inside the block inside PFRACBooleanCallback
as you said — I don't see it ever being reached.
Hit the nail on the head! I'm using -waitUntilCompleted:
because I'm writing synchronous tests against a Parse backend. I cannot tell which of these is causing the hang.
@kastiglione I found that if I use asynchronously
[[PFObject rac_deleteAll:objects] asynchronouslyWaitUntilCompleted:nil];
...it works. This could well be because XCTest manages test execution on the main thread but starts new threads for each test.
I made an issue over at ReactiveCocoa/ReactiveCocoa#1495 to document this. Cheers!
:beers:
I wanted to write unit tests against Parse and I came up with the following to purge a bunch of objects:
This call hung forever with a total of two objects passed in. Why?