Skip to content

Document .NET 11 ChangeToken.OnChange async-overload rebinding behavior - #55214

Merged
gewarren merged 4 commits into
mainfrom
copilot/breaking-change-update-changetoken-onchange
Aug 3, 2026
Merged

Document .NET 11 ChangeToken.OnChange async-overload rebinding behavior#55214
gewarren merged 4 commits into
mainfrom
copilot/breaking-change-update-changetoken-onchange

Conversation

CopilotAI commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

In .NET 11 Preview 7, new ChangeToken.OnChange async overloads (Func<Task> / Func<TState, Task>) can silently change overload resolution for existing async/Task callbacks after recompilation. The docs now explicitly describe the behavioral shift from async void-style fire-and-forget semantics to task-completion-based re-registration.

  • New breaking-change article (.NET 11 / Extensions)

    • Added docs/core/compatibility/extensions/11/changetoken-onchange-async-overloads-rebind-callbacks.md.
    • Captures prior vs. new binding behavior, runtime impact (re-registration timing, callback coalescing, exception flow), reason for change, and migration guidance.
  • Compatibility navigation and index updates

    • Added the new entry to:
      • docs/core/compatibility/11.md (Extensions table)
      • docs/core/compatibility/toc.yml (.NET 11 > Extensions)
  • Related primitives doc update

    • Updated docs/core/extensions/primitives.md to reflect that ChangeToken.OnChange consumers can now be synchronous (Action / Action<TState>) or asynchronous (Func<Task> / Func<TState, Task>).
// .NET 11 now binds this to Func<Task> overload (async Task), not Action (async void).ChangeToken.OnChange(config.GetReloadToken,async()=>{awaitTask.Delay(1000);Console.WriteLine("Reloaded");});

Internal previews

FilePreview link
docs/core/compatibility/11.mddocs/core/compatibility/11
docs/core/compatibility/extensions/11/changetoken-onchange-async-overloads-rebind-callbacks.mddocs/core/compatibility/extensions/11/changetoken-onchange-async-overloads-rebind-callbacks
docs/core/compatibility/toc.ymldocs/core/compatibility/toc
docs/core/extensions/primitives.mddocs/core/extensions/primitives

CopilotAI review requested due to automatic review settings August 3, 2026 17:42

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because there is no eligible user to bill. To allow Copilot reviews on bot-authored pull requests, enable direct organization billing in your organization's Copilot settings.

CopilotAI changed the title [WIP] Update ChangeToken.OnChange overloads for async callbacksDocument .NET 11 ChangeToken.OnChange async-overload rebinding behaviorAug 3, 2026
CopilotAI requested a review from gewarrenAugust 3, 2026 17:45
@gewarren
gewarren marked this pull request as ready for review August 3, 2026 18:42
@gewarren
gewarren requested a review from a team as a code ownerAugust 3, 2026 18:42
@gewarren
gewarren merged commit 0663600 into mainAug 3, 2026
12 checks passed
@gewarren
gewarren deleted the copilot/breaking-change-update-changetoken-onchange branch August 3, 2026 19:34
Sign up for freeto 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.

[Breaking change]: ChangeToken.OnChange async overloads change binding of existing async/Task-returning callbacks

4 participants

@gewarren@adegeo