feat(operators): add Repeat aliases#136
Merged
Merged
Conversation
Operators: - add Rx-name Repeat() and Repeat(int) aliases over observable sources - resubscribe through the current-thread trampoline to avoid recursive synchronous completion - guard each source attempt with generation and terminal-state checks so duplicate or late callbacks cannot schedule extra repeats Tests: - add TUnit coverage for finite, zero, bounded infinite, error, invalid argument, duplicate error, and stale terminal behavior Public API: - ship Repeat overloads for ReactiveUI.Primitives and ReactiveUI.Primitives.Reactive across the relevant TFMs
glennawatson
approved these changes
Jul 19, 2026
Extracted Repeat implementation from nested mixin classes into reusable Advanced types (`RepeatSourceSignal`, `RepeatSourceCoordinator`, and `RepeatSourceWitness`) and promoted them into the shipped public API across target frameworks. The repeat coordinator now explicitly handles source subscribe exceptions as a single downstream error and avoids duplicate terminal/repeat scheduling behavior. Added Repeat parity tests for subscribe-throw, duplicate completion, and stale late terminal/error paths, and standardized repository line-ending policy to LF via `.editorconfig` and `.gitattributes`.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #136 +/- ##
==========================================
+ Coverage 98.05% 98.06% +0.01%
==========================================
Files 672 676 +4
Lines 20851 20972 +121
Branches 2520 2538 +18
==========================================
+ Hits 20446 20567 +121
Misses 203 203
Partials 202 202 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Absorbs ReactiveUI.Primitives.Extensions.Core into ReactiveUI.Primitives.Core by using a Compile glob include, removing the standalone Extensions.Core project and its PublicAPI files, and updating all affected PublicAPI.Shipped.txt baselines to reflect the merged API surface.
ChrisPulman
marked this pull request as ready for review
July 19, 2026 17:40
Drops `ReactiveUI.Primitives.Extensions.Core` from the solution and from project references in `ReactiveUI.Primitives` and `ReactiveUI.Primitives.Reactive`, reflecting the decoupling from that assembly. The touched `.csproj` files also normalize XML self-closing tag spacing for consistency.
Project context: - Add the former Extensions.Core net4x dependency set to ReactiveUI.Primitives.Core so linked extension sources compile for .NET Framework TFMs. - Compile the shared InvalidOperationExceptionHelper into ReactiveUI.Primitives.Core because Extensions.Core sources now build inside that assembly. Public API baselines: - Fully qualify System.Threading.Tasks.ValueTask entries for net4x Primitives.Core baselines. - Regenerate the Primitives and Primitives.Reactive Android shipped baselines from their actual net10.0-android and net11.0-android surfaces. Validation: - dotnet build src/ReactiveUI.Primitives.slnx -c Release -m:1 /nr:false - dotnet test src/ReactiveUI.Primitives.slnx -c Release --no-build with Microsoft Testing Platform
Repeat coordinator:
- Separate generation matching from disposed-state checks so disposal guards remain explicit and testable without changing public API.
- Keep disposal short-circuiting for active-generation OnNext and terminal paths.
Coverage tests:
- Add focused TUnit coverage for post-disposal value, error, completion, stale completion generation, and disposed coordinator race guards.
Validation:
- dotnet build src/ReactiveUI.Primitives.slnx -c Release -m:1 /nr:false
- dotnet test src/ReactiveUI.Primitives.slnx -c Release --no-build via Microsoft Testing Platform
- RepeatSourceCoordinator{T}.cs has no missed coverage in the focused Cobertura report
|
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.



What kind of change does this PR introduce?
Feature
What is the new behavior?
Adds Rx-name
Repeat()andRepeat(int repeatCount)aliases for observable sources inReactiveUI.PrimitivesandReactiveUI.Primitives.Reactive.The implementation resubscribes through the current-thread trampoline and guards each source attempt with a generation/terminal gate so duplicate or late source callbacks cannot create extra repeats or premature completion.
What is the current behavior?
The Primitives operator surface does not expose Rx-compatible
Repeataliases for observable sources.Checklist
Additional information
Validation performed locally from
src:dotnet build tests/ReactiveUI.Primitives.Tests/ReactiveUI.Primitives.Tests.csproj -c Release -f net10.0 -m:1 /nr:falsedotnet build tests/ReactiveUI.Primitives.Reactive.Tests/ReactiveUI.Primitives.Reactive.Tests.csproj -c Release -f net10.0 -m:1 /nr:falsedotnet test tests/ReactiveUI.Primitives.Tests/ReactiveUI.Primitives.Tests.csproj -c Release -f net10.0 --no-build -- --treenode-filter "/*/*/RxNamesTests/*Repeat*" --output Normal --coverage --coverage-output-format cobertura --coverage-output repeat.coverage.cobertura.xml(7/7 passed)dotnet test tests/ReactiveUI.Primitives.Tests/ReactiveUI.Primitives.Tests.csproj -c Release -f net10.0 --no-build -- --output Normal --coverage --coverage-output-format cobertura --coverage-output lean.coverage.cobertura.xml(829/829 passed)dotnet test tests/ReactiveUI.Primitives.Reactive.Tests/ReactiveUI.Primitives.Reactive.Tests.csproj -c Release -f net10.0 --no-build -- --output Normal --coverage --coverage-output-format cobertura --coverage-output reactive.coverage.cobertura.xml(44/44 passed)dotnet build ReactiveUI.Primitives/ReactiveUI.Primitives.csproj -c Release -f net462 -m:1 /nr:falsedotnet build ReactiveUI.Primitives.Reactive/ReactiveUI.Primitives.Reactive.csproj -c Release -f net462 -m:1 /nr:falsedotnet build ReactiveUI.Primitives/ReactiveUI.Primitives.csproj -c Release -f net11.0 -m:1 /nr:falsedotnet build ReactiveUI.Primitives.Reactive/ReactiveUI.Primitives.Reactive.csproj -c Release -f net11.0 -m:1 /nr:falsePublic API audit:
PublicAPI.Unshipped.txtfiles contain only#nullable enable.ReactiveUI.PrimitivesandReactiveUI.Primitives.Reactiveand contain the new Repeat overloads for each relevant TFM.Coverage MCP summary after local runs: line coverage 40.43% (11090/27427), branch coverage 41.12% (3405/8280).
RepeatSourceObserver<T>reports 100% line and branch coverage in the lean Cobertura report.