refactor(scraper): Phase 2.4 — replace await-then-Match with functional operators#730
Merged
astar-development-jb merged 2 commits intoJul 11, 2026
Conversation
…perator Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Test results980 tests +4 963 ✅ +4 29s ⏱️ -11s For more details on these failures, see this check. Results for commit 7bd91dd. ± Comparison against base commit bc25716. |
astar-development-jb
approved these changes
Jul 11, 2026
15 tasks
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
Completes Phase 2 (Functional Paradigm Compliance) of
docs/astar-dev-wallpaper-scraper/code-review-2026-07-10.v2.mdby replacing the last await-then-Matchpatterns in the scraper workflows with functional operators.OrElseAsyncfallback operator toAStar.Dev.FunctionalParadigm(Task<Result<T,E>>.OrElseAsync(Func<TError, Task<Result<T,E>>> fallback)) — TDD: failing tests committed first, 4 new tests inGivenOrElseAsync.TopWallpapersWorkflow.LoadStartingPageAsync—OrElseAsyncchain falling back to first page.SubscriptionsWorkflow.LoadStartingPageAsync— sameOrElseAsyncretry chain.SearchWorkflow.ProcessSearchCategoriesAsync— loop early-exitMatchreplaced withBindAsyncaccumulator; first failure short-circuits further category processing, behaviour unchanged.Phase 2 items 5–7 were delivered in #726, #727 and #728; this PR delivers item 8, completing the phase.
Type of change
OrElseAsyncoperator inAStar.Dev.FunctionalParadigm)Related issues / links
Closes #725. Relates to #729 (tracking issue for the new package operator).
How was this tested?
GivenOrElseAsync: success skips fallback, failure invokes fallback with original error, fallback failure propagates.Impacted areas
TDD Checklist (required)
dotnet clean && dotnet build --no-restore— 0 errors, 0 code warnings; only pre-existing NU1903 NuGet advisories inspikes/)dotnet test --no-build— FunctionalParadigm 135/135; scraper 419 pass / 16 fail and OneDrive 2135 pass / 21 fail are identical onmain— zero new failures)OrElseAsyncadded; no existing signatures changed)How to run tests locally
Notes for reviewers
SearchWorkflowaccumulator: on failureBindAsyncskips the binder, so remaining categories are not processed and the first error is returned — same semantics as the previous earlyreturn.🤖 Generated with Claude Code