fix(quality): rename ct to cancellationToken in all MediatR handlers - #144
Conversation
…closes #137 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
🏗️ PR Added to Squad Triage QueueThis PR has been labeled with Next steps:
|
There was a problem hiding this comment.
Pull request overview
Renames MediatR handler Handle method CancellationToken parameters from ct to cancellationToken (and updates all in-method usages) to resolve CA1725 and align with MediatR’s interface parameter naming.
Changes:
- Updated all affected MediatR
Handlemethod signatures to usecancellationToken. - Updated all downstream calls within handlers to pass
cancellationToken. - Renamed
UserManagementHandler’s privateGetManagementClientAsyncparameter and updated its call sites.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/Web/Features/UserManagement/UserManagementHandler.cs | Renames ct → cancellationToken across all handler methods and the GetManagementClientAsync helper, updating all usages. |
| src/Web/Features/BlogPosts/List/GetBlogPostsHandler.cs | Renames handler token parameter and updates repository/cache calls accordingly. |
| src/Web/Features/BlogPosts/Edit/EditBlogPostHandler.cs | Renames token parameter in both Handle overloads and updates repository/cache calls. |
| src/Web/Features/BlogPosts/Delete/DeleteBlogPostHandler.cs | Renames token parameter and updates repository/cache invalidation calls. |
| src/Web/Features/BlogPosts/Create/CreateBlogPostHandler.cs | Renames token parameter and updates repository/cache invalidation calls. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## sprint/6-code-quality #144 +/- ##
======================================================
Coverage 76.93% 76.93%
======================================================
Files 43 43
Lines 672 672
Branches 111 111
======================================================
Hits 517 517
Misses 105 105
Partials 50 50
🚀 New features to boost your workflow:
|
## Sprint 6: Code Quality **Goal:** Eliminate analyzer warnings, enforce internal visibility on Web feature types, expand test coverage, and migrate Unit.Tests into Web.Tests. --- ## Merged Feature PRs - Closes #137 — PR #144 — fix(quality): rename `ct` → `cancellationToken` in all MediatR handlers - Closes #138 — PR #145 — test: add unit tests for BlogPost, Result, and ValidationBehavior (42 tests) - Closes #139 — PR #146 — test: add unit tests for UserManagementHandler (16 tests) - Closes #140 — PR #147 — fix(quality): make Web feature types `internal` (CA1515, ~28 types) - Closes #141 — PR #148 — test: add unit tests for BlogPostMappings (22 tests) - Closes #142 — PR #149 — fix(quality): add ConfigureAwait(false) and specific exception catches - Closes #143 — PR #150 — fix(quality): address Domain and ServiceDefaults analyzer warnings - Closes #151 — PR #152 — feat(tests): migrate Unit.Tests → Web.Tests and remove Unit.Tests project --- ## Test Summary - **80+ new tests** added across all PRs - **105 Web.Tests passing** (0 failures) - `DynamicProxyGenAssembly2` added to `InternalsVisibleTo` in Web.csproj for NSubstitute support ## Notable Changes - `Unit.Tests` project removed; all tests now live in `Web.Tests` - ~28 Web feature types changed from `public` to `internal` (CA1515 compliance) - All MediatR handler parameters renamed from `ct` to `cancellationToken` for clarity - `ConfigureAwait(false)` applied to all async calls in service layer - Domain and ServiceDefaults analyzer warnings resolved --- ## Checklist - [x] All sprint issues closed (#137–#143, #151) - [x] CI green (0 build errors) - [x] 105 Web.Tests passing - [x] Milestone at 100% --------- Co-authored-by: Boromir <boromir@squad.dev> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Closes #137
Working as Sam (Backend Developer)
Renames the
ctparameter tocancellationTokenin everyHandlemethod signature and all usages inside the method body across all MediatR handlers, plus the privateGetManagementClientAsynchelper inUserManagementHandler. Addresses CA1725.