Skip to content

docs: add XML doc comments on WhenAll exception behavior (fixes #514)#717

Open
YIMO691 wants to merge 1 commit into
Cysharp:masterfrom
YIMO691:master
Open

docs: add XML doc comments on WhenAll exception behavior (fixes #514)#717
YIMO691 wants to merge 1 commit into
Cysharp:masterfrom
YIMO691:master

Conversation

@YIMO691

@YIMO691 YIMO691 commented May 30, 2026

Copy link
Copy Markdown

Summary

Add XML documentation comments to WhenAll and WhenAll<T> methods clarifying the behavioral difference from standard .NET Task.WhenAll.

Problem (Issue #514)

UniTask.WhenAll exits immediately when any task throws an exception, unlike .NET Task.WhenAll which waits for ALL tasks to complete and wraps errors in AggregateException.

Root Cause

In WhenAllPromise<T>.TryInvokeContinuation() (WhenAll.cs L101-117):

  • On exception: core.TrySetException(ex); return; — immediately completes the promise
  • Other running tasks are not waited for

Fix

Added XML doc comments on WhenAll / WhenAll<T>:

  • <summary>: Documents that WhenAll completes immediately on first exception
  • <remarks>: Explains the difference from .NET Task.WhenAll and suggests workarounds (try-catch wrapper, SuppressCancellationThrow)

Changes

  • UniTask.WhenAll.cs: +15 lines (XML doc only, no behavior change)

Closes #514

🤖 Generated with Claude Code

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.

WhenAll exits early when any task has an exception

1 participant