fix: dispose the displaced binding when BindCommandUnsafe rebinds; build without runtime-async - #165
Merged
Conversation
glennawatson
force-pushed
the
fix/bindcommand-dispose-displaced-binding
branch
from
October 3, 2026 05:21
4409109 to
6a8b03b
Compare
- RuntimeCommandBindingFallback and RuntimeInteractionFallback hold the current binding in a SwapDisposable, so a rebind disposes the binding it replaces. - Add tests for one active binding per call and for disposal after a rebind. - Build the .NET 11 assemblies without runtime-async. Mono does not support it, so it breaks Blazor WebAssembly and other Mono hosts. - Update TUnit to 1.72.16. - Fix the benchmarks for ReactiveUI 25: drop an unused using, and let the generated ToProperty name CountViewModel. Fixes #163 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
glennawatson
force-pushed
the
fix/bindcommand-dispose-displaced-binding
branch
from
October 3, 2026 05:26
6a8b03b to
95fbd1c
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #165 +/- ##
=======================================
Coverage 99.23% 99.23%
=======================================
Files 396 396
Lines 14469 14469
Branches 2065 2065
=======================================
Hits 14359 14359
Misses 110 110 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
glennawatson
added a commit
that referenced
this pull request
Oct 3, 2026
- RuntimeCommandBindingFallback and RuntimeInteractionFallback hold the current binding in a SwapDisposable, so a rebind disposes the binding it replaces. - Add tests for one active binding per call and for disposal after a rebind. - Build the .NET 11 assemblies without runtime-async. Mono does not support it, so it breaks Blazor WebAssembly and other Mono hosts. - Update TUnit to 1.72.16. - Fix the benchmarks for ReactiveUI 25: drop an unused using, and let the generated ToProperty name CountViewModel. Fixes #163
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
BindCommandUnsafeandBindInteractionUnsafenow keep one live binding per call, and the .NET 11 build no longer uses runtime-async.Why
Each change notification on a link in the control chain added another live binding. The command then ran once per binding, and the extra bindings stayed attached after the returned disposable was disposed. Closes #163.
Separately, Blazor WebAssembly, Avalonia's browser apps and other Mono hosts can fail on a runtime-async build.
Breaking changes
The .NET 11 assemblies no longer use runtime-async. The public API does not change. This ships as a major release because of the runtime change.
How this was verified
New tests cover repeated link notifications keeping one binding, disposal detaching the command, and a replaced interaction disposing its old registration.
Notes for the reviewer
The fix is the
SwapDisposablechange inRuntimeCommandBindingFallbackandRuntimeInteractionFallback. The generator's emitted code already usedSwapDisposable, so it is unchanged. TheDirectory.Build.propsand benchmark edits are mechanical.Checklist