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

Add taskForCompletionOfAllTasksWithResults and faulted property #76

Merged
1 commit merged into from
Jan 26, 2015
Merged

Add taskForCompletionOfAllTasksWithResults and faulted property #76

1 commit merged into from
Jan 26, 2015

Conversation

josephearl
Copy link

Add taskForCompletionOfAllTaskResults to match Task.whenAllResult in Bolts-Android. All tasks should be of the same type.

Also add isFaulted property for consistency with Android and C#, tests for taskForCompletionOfAllTaskResults & missing tests for immediate completion of taskForCompletionOfAllTask and taskForCompletionOfAllTaskResults.

Similar to #74 but this adds a new method rather than modifying the existing one.

@ghost
Copy link

ghost commented Jan 26, 2015

Hey Joseph, this looks really good.
Few nits, but overall - awesome.

The only thing that I am not sure is the method name.
taskForCompletionOfAllTaskResults - implies that this task is for completion of all results, but not tasks themselves.
Maybe use something like taskForCompletionOfAllTasksWithResults, though I am not 100% sure about the name.

@grantland what do you think?

@josephearl
Copy link
Author

@nlutsenko-fb updated & squashed. I renamed the method to taskForCompletionOfAllTasksWithResults as per your suggestion.

Here was the same change for Android FYI BoltsFramework/Bolts-Android#46

@josephearl josephearl changed the title Add taskForCompletionOfAllTaskResults and isFaulted property Add taskForCompletionOfAllTasksWithResults and faulted property Jan 26, 2015
ghost pushed a commit that referenced this pull request Jan 26, 2015
Add taskForCompletionOfAllTasksWithResults and faulted property
@ghost ghost merged commit 8721616 into BoltsFramework:master Jan 26, 2015
@wdcurry
Copy link

wdcurry commented May 28, 2015

I found this thread via a search on: Bolts "faulted = YES" ...
I am using Bolts via Parse, and am seeing an untrappable bolts error, trying to set an error, with no error except the faulted = YES .. with no hint, no clue, no ANYTHING except a stopped app.

The ONLY thing changed between a working app and this was UI settings of another view, a child of the offending view.

Unsettling that Bolts is giving nothing to act on yet is stopping my app from running. For now i am going to toss in a check for a nil error and ignore, but this is frustrating. ;)

The stoppage occurs in:

  • (void)setError:(NSError *)error {
    if (![self trySetError:error]) {
    [NSException raise:NSInternalInconsistencyException
    format:@"Cannot set the error on a completed task."];
    }
    }

@josephearl josephearl deleted the feature/whenall-result branch May 28, 2015 16:29
@josephearl
Copy link
Author

Please could you open a new issue and provide as much detail as possible there -- since this issue was closed the information may get missed here.

If you could elaborate a little more on how you are using tasks it would be helpful:

  • Are you using the taskForCompletionOfAllTasksWithResults or taskForCompletionOfAllTasks APIs?
  • Is it your own code that is calling setError? Or something within Parse or Bolts?
  • Any links to APIs you are using or code would be helpful

@wdcurry
Copy link

wdcurry commented May 28, 2015

This is buried in Parse's implementation of Bolts within their PFQueryTableViewController. The most frustrating part is that there is NO data error here, guaranteed. And the rest of the app, using bolts, parse and the backend is working and i have done nothing to the view that barfs.

@wdcurry
Copy link

wdcurry commented May 28, 2015

and yes.. i will open another ;)

@josephearl
Copy link
Author

Great thanks 😄 So is the NSInternalInconsistencyException being raised? Or some other exception is raised when trySetError is called?

@facebook-github-bot
Copy link
Contributor

@josephearl updated the pull request.

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants