Skip to content

feat(operators): add Repeat aliases#136

Merged
ChrisPulman merged 6 commits into
mainfrom
CP_add-repeat-rx-operator
Jul 19, 2026
Merged

feat(operators): add Repeat aliases#136
ChrisPulman merged 6 commits into
mainfrom
CP_add-repeat-rx-operator

Conversation

@ChrisPulman

Copy link
Copy Markdown
Member

What kind of change does this PR introduce?

Feature

What is the new behavior?

Adds Rx-name Repeat() and Repeat(int repeatCount) aliases for observable sources in ReactiveUI.Primitives and ReactiveUI.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 Repeat aliases for observable sources.

Checklist

  • Tests have been added or updated (for bug fixes / features)
  • Docs have been added or updated (for bug fixes / features)
  • Changes target the main branch
  • PR title follows Conventional Commits

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:false
  • dotnet build tests/ReactiveUI.Primitives.Reactive.Tests/ReactiveUI.Primitives.Reactive.Tests.csproj -c Release -f net10.0 -m:1 /nr:false
  • dotnet 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:false
  • dotnet build ReactiveUI.Primitives.Reactive/ReactiveUI.Primitives.Reactive.csproj -c Release -f net462 -m:1 /nr:false
  • dotnet build ReactiveUI.Primitives/ReactiveUI.Primitives.csproj -c Release -f net11.0 -m:1 /nr:false
  • dotnet build ReactiveUI.Primitives.Reactive/ReactiveUI.Primitives.Reactive.csproj -c Release -f net11.0 -m:1 /nr:false

Public API audit:

  • All PublicAPI.Unshipped.txt files contain only #nullable enable.
  • The changed shipped baselines are scoped to ReactiveUI.Primitives and ReactiveUI.Primitives.Reactive and 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.

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
Comment thread src/Primitives.Shared/SignalOperatorParityMixins.RxNames.Repeat.cs Outdated
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

codecov Bot commented Jul 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.06%. Comparing base (a554f24) to head (8627f81).

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.
📢 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.

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
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
@sonarqubecloud

Copy link
Copy Markdown

@ChrisPulman
ChrisPulman merged commit f12dcad into main Jul 19, 2026
13 checks passed
@ChrisPulman
ChrisPulman deleted the CP_add-repeat-rx-operator branch July 19, 2026 20:05
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