Refactor names to blend with Primitives naming#24
Open
ChrisPulman wants to merge 14 commits into
Open
Conversation
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.
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 Report❌ Patch coverage is 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. 🚀 New features to boost your workflow:
|
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.
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(); |
|
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.


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