Fix Recover button action resolution in funded projects#712
Open
SuperJMN wants to merge 2 commits intoblock-core:mainfrom
Open
Fix Recover button action resolution in funded projects#712SuperJMN wants to merge 2 commits intoblock-core:mainfrom
SuperJMN wants to merge 2 commits intoblock-core:mainfrom
Conversation
…etter modularity and reusability. Rename `Recovery` to `RecoveryState` for consistency. Simplify `PreviewAndCommit` method to return `Maybe<Result>`. Update DI to include `IFundedCommandsFactory` registration.
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.
Summary
This PR fixes a bug in the
Recoverflow by using IDialog.ShowAndGetResult properly.In practice, this makes the
Recoverbutton behave more reliably because the UI and the command execution path now follow the same source of truth.Also, the
FundedBase, that is a ViewModel after all, was handly too many responsibilities, something that is damaging testability and maintainability.What changed
RecoveryActionKindto make the available recovery actions explicitRecoveryActionPolicyto centralize recovery-state-to-action resolutionFundedCommandsFactoryto consume the resolved action instead of spreading the decision across several condition blocksRecoveryState, leaving it as plain state dataWhy this is the right direction
This is more than a bug fix.
The previous flow mixed raw state inspection with action selection in multiple places, which made it easier for the
Recoverbutton to present one thing and execute another. With the new policy-based approach, the same action resolution drives:That gives us better responsibility boundaries and a much more testable shape.
RecoveryStatestays as data, whileRecoveryActionPolicyowns the decision logic. That separation should make future recovery-related changes safer and easier to verify.Validation
dotnet test AngorApp.Tests/AngorApp.Tests.csproj --no-restore