Tags: reactiveui/ReactiveUI
Tags
fix: resolve builder StackOverflow, activator negative refCount, bind… …ing regression, and testing extensions (#4301) ## What's Changed ### Builder converter registration no longer causes StackOverflow Calling `WithFallbackConverter`, `WithConverter`, `WithSetMethodConverter`, or `WithConvertersFrom` on `IReactiveUIBuilder` previously caused a `StackOverflowException` due to infinite recursion. These methods now work correctly. ### ViewModelActivator no longer goes into a broken state on extra Deactivate calls If `Deactivate()` was called more times than `Activate()`, the internal reference count would go negative, preventing future activations from working. The activator now safely ignores extra deactivation calls. ### Two-way bindings work again with base types like System.Object Two-way bindings between a view model property of a derived type (e.g. `string`) and a view property of a base type (e.g. `object`) were throwing `ArgumentException`. This is now permitted as expected. ### TestScheduler extensions (AdvanceByMs, AdvanceToMs, etc.) are discoverable again After adding the `ReactiveUI.Testing.Reactive` package, `AdvanceByMs`, `AdvanceToMs`, `OnNextAt`, and related extensions are now available with just `using ReactiveUI.Testing;` -- no additional namespace import needed. Fixes #4293 Fixes #4283 Fixes #4298 Fixes #4297 --- ## Maintainer Notes - **IReactiveUIBuilder.cs**: Added 9 converter method signatures (`WithConverter` x4, `WithFallbackConverter` x2, `WithSetMethodConverter` x2, `WithConvertersFrom` x1) to the interface. These were previously only on the concrete `ReactiveUIBuilder` class, causing the extension methods in `BuilderMixins.cs` to resolve back to themselves instead of dispatching to the implementation. - **ViewModelActivator.cs**: Replaced `Interlocked.Decrement` in `Deactivate()` with a CAS (CompareExchange) loop that refuses to decrement below zero. The `ignoreRefCount` path now explicitly resets to 0. - **PropertyBinderImplementation.cs**: Changed the type assignability check from `&&` (mutual) to `||` (one-directional). The existing fallback conversion logic at lines 180-184 already handles one-directional assignment. - **TestSchedulerExtensions.cs**: Changed namespace from `ReactiveUI.Testing.Reactive` to `ReactiveUI.Testing`. The assembly/package name remains `ReactiveUI.Testing.Reactive` -- the move to a separate package is intentional to keep `ReactiveUI.Testing` free of the `Microsoft.Reactive.Testing` dependency. - **Test updates**: Added new interface members to `TestReactiveUIBuilder` mock in Blazor tests, removed now-unnecessary `using ReactiveUI.Testing.Reactive` from scheduler tests.
chore(deps): update dependency verify.tunit to 31.10.0 (#4281) This PR contains the following updates: | Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) | |---|---|---|---| | [Verify.TUnit](https://redirect.github.com/VerifyTests/Verify) | `31.9.4` → `31.10.0` |  |  | --- ### Release Notes <details> <summary>VerifyTests/Verify (Verify.TUnit)</summary> ### [`v31.10.0`](https://redirect.github.com/VerifyTests/Verify/compare/31.9.4...31.10.0) [Compare Source](https://redirect.github.com/VerifyTests/Verify/compare/31.9.4...31.10.0) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/reactiveui/ReactiveUI). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0Mi45Mi4xIiwidXBkYXRlZEluVmVyIjoiNDIuOTIuMSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiRGVwZW5kZW5jeSBNYW5hZ2VtZW50Il19--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
PreviousNext