Skip to content

Refactor names to blend with Primitives naming#24

Open
ChrisPulman wants to merge 14 commits into
mainfrom
RefactorNaming
Open

Refactor names to blend with Primitives naming#24
ChrisPulman wants to merge 14 commits into
mainfrom
RefactorNaming

Conversation

@ChrisPulman
Copy link
Copy Markdown
Member

Apply widespread renames and API clarifications across ReactiveUI.Primitives.Async.
Key changes: replace anonymous/empty disposable types with clearer Delegate/Noop names; unify disposed sentinels to DisposedSlotMarker and rename DisposalHelper.IsDisposed -> HasDisposed; rename AsyncGate -> AsyncSerialGate and LockAsync/Releaser -> EnterAsync/Lease (with related wake/ wait method renames); rename CombineLatestSubscriptionBase -> CombineLatestCoordinatorBase and adjust lifecycle names (e.g. CompleteAsync -> FinishAsync, OnErrorResume -> RelaySourceErrorAsync); update various Observer/Signal wrapper names (Anonymous* -> Delegate*, Wrapped -> Forwarding*), task/witness base class references, and other identifier updates.
Tests and operator/signal files updated accordingly.
The changes are primarily renames and refactors to improve clarity and consistency without intended behavioral changes.

Add Collect, EmitIfQuiet, Defer, and ToEnumerable

Apply widespread renames and API clarifications across ReactiveUI.Primitives.Async. Key changes: replace anonymous/empty disposable types with clearer Delegate/Noop names; unify disposed sentinels to DisposedSlotMarker and rename DisposalHelper.IsDisposed -> HasDisposed; rename AsyncGate -> AsyncSerialGate and LockAsync/Releaser -> EnterAsync/Lease (with related wake/ wait method renames); rename CombineLatestSubscriptionBase -> CombineLatestCoordinatorBase and adjust lifecycle names (e.g. CompleteAsync -> FinishAsync, OnErrorResume -> RelaySourceErrorAsync); update various Observer/Signal wrapper names (Anonymous* -> Delegate*, Wrapped -> Forwarding*), task/witness base class references, and other identifier updates. Tests and operator/signal files updated accordingly. The changes are primarily renames and refactors to improve clarity and consistency without intended behavioral changes.
Comment thread src/ReactiveUI.Primitives.Async/Internals/CombineLatestLifecycle.cs Fixed
Comment thread src/ReactiveUI.Primitives.Async/Internals/TakeUntilLifecycle.cs Fixed
Introduce new FlatMap overload that accepts a collection selector and result selector (returns FlatMapResultSignal) and add a FlatMapValues<TSource, TResult> extension for projecting each source value to an IEnumerable and emitting its items. Add null-argument guard tests and a behavior test for FlatMapValues, and refresh API approval snapshots to reflect the public API changes (FlatMapValues, Collect/Buffer renames, EmitIfQuiet, FromEventPattern generic signature changes, and removal of Throttle entries).
Update API approval snapshots to reflect the rename of ObserveOn extension methods to WitnessOn for IObservableAsync. Removed the ObserveOn overloads and added matching WitnessOn overloads in the .verified files for .NET 8.0, 9.0 and 10.0 (src/tests/ReactiveUI.Primitives.Async.Tests/ApiApprovalTests.Async.DotNet8_0.verified.txt, ApiApprovalTests.Async.DotNet9_0.verified.txt, ApiApprovalTests.Async.DotNet10_0.verified.txt). This keeps the public API approvals in sync with the codebase rename.
@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 5, 2026

Codecov Report

❌ Patch coverage is 96.94656% with 24 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.10%. Comparing base (ad00bbd) to head (e25398f).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...gnals/Base/BaseStatelessReplayLatestSignalAsync.cs 71.42% 7 Missing and 5 partials ⚠️
....Async/Signals/Base/BaseReplayLatestSignalAsync.cs 78.94% 5 Missing and 3 partials ⚠️
src/ReactiveUI.Primitives.Async/AsyncContext.cs 50.00% 0 Missing and 1 partial ⚠️
...tives.Async/Internals/TaskSignalSubscription{T}.cs 75.00% 1 Missing ⚠️
...veUI.Primitives.Async/Mixins/AsyncContextMixins.cs 0.00% 0 Missing and 1 partial ⚠️
...c/ReactiveUI.Primitives/Signals/Signal{Collect}.cs 98.43% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #24      +/-   ##
==========================================
+ Coverage   91.93%   92.10%   +0.16%     
==========================================
  Files         407      409       +2     
  Lines       16019    16235     +216     
  Branches     2363     2395      +32     
==========================================
+ Hits        14727    14953     +226     
+ Misses        971      953      -18     
- Partials      321      329       +8     

☔ View full report in Codecov by Harness.
📢 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.

Core signal coverage:
- Add deterministic tests for Collect and EmitIfQuiet immediate, scheduled, terminal, error, and stopped-guard paths.
- Add coverage for Defer, ToEnumerable, and generic FromEventPattern handler branches.
- Keep Collect.Flush behavior unchanged while avoiding an unreachable canceled early-return coverage line.

Async coverage:
- Add tests for renamed AsyncContext and ObserverAsync internal members used by the PR diff.
- Cover ObserverAsync unhandled error, disposal, and completion reporting paths.
- Add non-forced WitnessOn overload tests for SynchronizationContext and TaskScheduler wrappers.

Verification:
- dotnet build src/ReactiveUI.Primitives.slnx -c Release --no-restore passed.
- ReactiveUI.Primitives.Tests passed net8.0/net9.0/net10.0: 287/287.
- ReactiveUI.Primitives.Async.Tests passed net8.0/net9.0/net10.0: 1188/1188.
- MTP coverage checks show no missed added/changed PR lines for Codecov-listed files.
CI Failure

- Replace a fixed delay in DropIfBusyObservableTests.WhenHandlerThrowsBeforeDone_ThenForwardsError with a TaskCompletionSource-backed wait for the downstream error callback.

- Preserve the same-reference assertion once the async handler failure has definitely been delivered.

Verification

- dotnet run --project src/tests/ReactiveUI.Primitives.Extensions.Tests/ReactiveUI.Primitives.Extensions.Tests.csproj -c Release -f net8.0 -- --no-progress --coverage --coverage-output-format cobertura --coverage-output extensions-net8-fix.cobertura.xml --results-directory .tmp/ci24-coverage/extensions-net8-fix

- dotnet run --project src/tests/ReactiveUI.Primitives.Extensions.Tests/ReactiveUI.Primitives.Extensions.Tests.csproj -c Release -f net9.0 -- --no-progress

- dotnet run --project src/tests/ReactiveUI.Primitives.Extensions.Tests/ReactiveUI.Primitives.Extensions.Tests.csproj -c Release -f net10.0 -- --no-progress

- dotnet build src/ReactiveUI.Primitives.slnx -c Release --no-restore
Rename several internal types and identifiers to clarify intent and update usages across the async primitives library. Key changes: Delegate* -> Callback* (DelegateSignalAsync -> CallbackSignalAsync, DelegateAsyncWitness -> CallbackWitnessAsync), Observer* -> Witness* (CombineLatestIndexedObserver -> CombineLatestIndexedWitness, SingleElementObserver -> SingleElementWitness, TakeUntilSourceObserver -> TakeUntilSourceWitness, etc.), ForwardingAsyncWitness -> RelayWitnessAsync, and TaskWitnessAsyncBase -> TaskResultWitnessAsyncBase. Updated all operator and internals references, XML docs, and usages (e.g. Create, Multicast, CombineLatest operators). Added AsyncSignalSubscriptionBenchmarks.cs and updated tests to match the renames.
ChrisPulman and others added 8 commits June 6, 2026 06:16
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
{
/// <summary>Serializes downstream notifications so OnNext / OnError / OnCompleted never overlap.</summary>
private readonly AsyncGate _gate = new();
private readonly AsyncSerialGate _gate = new();

/// <summary>Serializes downstream notifications so OnNext / OnError / OnCompleted never overlap.</summary>
private readonly AsyncGate _gate = new();
private readonly AsyncSerialGate _gate = new();
{
/// <summary>Synchronization gate.</summary>
private readonly AsyncGate _gate = new();
private readonly AsyncSerialGate _gate = new();
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Jun 6, 2026

Quality Gate Failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

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.

1 participant