Skip to content

Refreshable ensure initialized#15

Merged
RFBomb merged 6 commits intomasterfrom
Refreshable_EnsureInitialized
Apr 16, 2026
Merged

Refreshable ensure initialized#15
RFBomb merged 6 commits intomasterfrom
Refreshable_EnsureInitialized

Conversation

@RFBomb
Copy link
Copy Markdown
Contributor

@RFBomb RFBomb commented Apr 16, 2026

  • Adds EnsureInitialized() and EnsureInitializedAsync to the RefreshableSelectors to allow callers to conditionally perform the first refresh and wait for its completion.
  • Added RefreshFailedException to allow EnsureInitialized to provide more details about the failure

RFBomb added 2 commits April 16, 2026 14:56
- Adds EnsureInitialized() and EnsureInitializedAsync to the RefreshableSelectors to allow callers to conditionally perform the first refresh and wait for its completion.
- Added RefreshFailedException to allow EnsureInitialized to provide more details about the failure
@RFBomb RFBomb self-assigned this Apr 16, 2026
Copilot AI review requested due to automatic review settings April 16, 2026 18:58
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds “ensure initialized” APIs to RefreshableSelector so callers can trigger the first refresh only when needed and (optionally) wait for it, with failures surfaced via a dedicated RefreshFailedException.

Changes:

  • Added EnsureInitialized() / EnsureInitializedAsync(CancellationToken) to RefreshableSelector, plus supporting initialization state tracking.
  • Introduced RefreshFailedException to wrap/standardize initialization failures.
  • Expanded RefreshableSelectorTests to cover initialization behavior, failure paths, and some async refresh behaviors.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 11 comments.

Show a summary per file
File Description
src/Mvvm.Controls/Mvvm/RefreshableSelector.cs Adds initialization APIs and changes initialization/refresh state handling.
src/Mvvm.Controls/Mvvm/RefreshFailedException.cs New exception type used by EnsureInitialized APIs.
src/Mvvm.Controls/SystemExtensions.cs Adds an int CompareExchange extension used for atomic state transitions.
tests/MvvmControlsTests/Mvvm.Tests/RefreshableSelectorTests.cs Adds tests for EnsureInitialized/EnsureInitializedAsync and refresh cancellation behavior.
src/Mvvm.Version.targets Bumps solution version.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/Mvvm.Controls/Mvvm/RefreshableSelector.cs Outdated
Comment thread src/Mvvm.Controls/Mvvm/RefreshableSelector.cs
Comment thread src/Mvvm.Controls/Mvvm/RefreshableSelector.cs Outdated
Comment thread src/Mvvm.Controls/Mvvm/RefreshableSelector.cs Outdated
Comment thread src/Mvvm.Controls/Mvvm/RefreshableSelector.cs Outdated
Comment thread src/Mvvm.Controls/Mvvm/RefreshableSelector.cs Outdated
Comment thread src/Mvvm.Controls/SystemExtensions.cs Outdated
Comment thread src/Mvvm.Controls/Mvvm/RefreshFailedException.cs Outdated
Comment thread tests/MvvmControlsTests/Mvvm.Tests/RefreshableSelectorTests.cs Outdated
Comment thread tests/MvvmControlsTests/Mvvm.Tests/RefreshableSelectorTests.cs
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/Mvvm.Controls/Mvvm/RefreshFailedException.cs
Comment thread src/Mvvm.Controls/Mvvm/RefreshableSelector.cs
Comment thread src/Mvvm.Controls/Mvvm/RefreshableSelector.cs
Comment thread src/Mvvm.Controls/Mvvm/RefreshableSelector.cs Outdated
Resolved issue with spinwait
@RFBomb RFBomb merged commit 05eb281 into master Apr 16, 2026
1 check failed
@RFBomb RFBomb deleted the Refreshable_EnsureInitialized branch April 16, 2026 20:34
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