Skip to content

Add ReactiveUI.Primitives.Async parity, bridges, tests, and benchmarks#12

Merged
glennawatson merged 3 commits into
mainfrom
AddReactiveUI.Primitives.Async
May 30, 2026
Merged

Add ReactiveUI.Primitives.Async parity, bridges, tests, and benchmarks#12
glennawatson merged 3 commits into
mainfrom
AddReactiveUI.Primitives.Async

Conversation

@ChrisPulman
Copy link
Copy Markdown
Member

Summary

  • Added the new ReactiveUI.Primitives.Async project and aligned its API naming with the existing primitives vocabulary.
  • Refactored async context and ISequencer handling to behave consistently with the core primitives model.
  • Extended the existing source generators to emit conditional async bridges for System.Reactive and R3 when ReactiveUI.Primitives.Async is referenced.
  • Ported the async test suite from ReactiveUI.Extensions.Tests.Async and added focused contract coverage for the new async surface.
  • Added BenchmarkDotNet comparisons against ReactiveUI.Extensions 4.0.0 for key async scenarios.

Testing

  • ReactiveUI.Primitives.Async builds across net462, net472, net481, net8.0, net9.0, and net10.0.
  • TUnit/MTP test runs passed for net8.0, net9.0, and net10.0 with 1367 tests each.
  • Coverage for ReactiveUI.Primitives.Async is 98.20% line and 97.83% branch.
  • Benchmark smoke passed, and the new async comparison benchmarks ran successfully against ReactiveUI.Extensions 4.0.0.

Runtime fix:
- Observe faulted FromTask operations after cancellation with a non-cancelable continuation on the default scheduler.
- Avoid awaiting the fault-observation continuation so cancellation paths cannot reintroduce unobserved task exceptions.

Test isolation:
- Enable the TUnit unhandled-exception executor assembly-wide and mark the test assembly not-in-parallel because the handler is process-wide global state.
- Add UnhandledExceptionCapture to restore the previous handler and wait for the expected exception message.
- Update async unhandled-exception tests to assert their own routed exception instead of the first global callback to arrive.

Verification:
- dotnet build .\ReactiveUI.Primitives.slnx --configuration Release --no-restore
- dotnet test --solution .\ReactiveUI.Primitives.slnx --no-build --configuration Release --timeout 15m --coverage --coverage-output-format cobertura --results-directory .\TestResults\ci-local
- MTP coverage MCP: line 91.57%, branch 85.72%
@codecov
Copy link
Copy Markdown

codecov Bot commented May 30, 2026

Codecov Report

❌ Patch coverage is 98.59256% with 59 lines in your changes missing coverage. Please review.
✅ Project coverage is 95.48%. Comparing base (7e4e440) to head (16caaae).

Files with missing lines Patch % Lines
src/ReactiveUI.Primitives.Async/AsyncContext.cs 61.40% 18 Missing and 4 partials ⚠️
src/ReactiveUI.Primitives.Async/ObserverAsync.cs 89.34% 15 Missing and 3 partials ⚠️
...imitives.Async/ConcurrentObserverCallsException.cs 33.33% 4 Missing ⚠️
...nc/Disposables/SingleReplaceableDisposableAsync.cs 85.71% 2 Missing and 1 partial ⚠️
...ctiveUI.Primitives.Async/ConcurrencyRaceHelpers.cs 66.66% 2 Missing ⚠️
...s.Async/Internals/CancelableTaskSubscription{T}.cs 91.66% 2 Missing ⚠️
...ReactiveUI.Primitives.Async/Operators/ObserveOn.cs 81.81% 2 Missing ⚠️
...I.Primitives.Async/Internals/SubscriptionHelper.cs 85.71% 0 Missing and 1 partial ⚠️
...rimitives.Async/Internals/TaskObserverAsyncBase.cs 95.00% 1 Missing ⚠️
...veUI.Primitives.Async/Mixins/AsyncContextMixins.cs 88.88% 0 Missing and 1 partial ⚠️
... and 3 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #12      +/-   ##
==========================================
+ Coverage   92.79%   95.48%   +2.69%     
==========================================
  Files          97      235     +138     
  Lines        4677     9972    +5295     
  Branches      858     1405     +547     
==========================================
+ Hits         4340     9522    +5182     
- Misses        199      291      +92     
- Partials      138      159      +21     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sonarqubecloud
Copy link
Copy Markdown

@glennawatson glennawatson merged commit 709fc9d into main May 30, 2026
14 checks passed
@glennawatson glennawatson deleted the AddReactiveUI.Primitives.Async branch May 30, 2026 11:54
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.

2 participants