Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Pass back real result for single task chains
When chains are delayed, they are first frozen as part of preparation which causes the sub-tasks to also be frozen. Afterward, the final (0th since we reverse the tasks/result order when freezing) result object from the freezing process would be passed back to the caller. This caused problems in signaling completion of groups contained in chains because the group relies on a promise which is fulfilled by a barrier linked to each of its applied subtasks. By constructing two `GroupResult` objects (one during freezing, one when the chain sub-tasks are applied), this resulted in there being two promises; only one of which would actually be fulfilled by the group subtasks. This change ensures that in the special case where the final task of a chain is a group, we pass back the `GroupResult` object constructed when the group was actually applied. The caller can then await the result confidently!
- Loading branch information