From 45441c1d07784bf5a765ce61d5e02999f7929b26 Mon Sep 17 00:00:00 2001 From: Scott Pouliot Date: Tue, 28 Apr 2026 21:25:30 -0400 Subject: [PATCH] Fix 'Customize your workflow' done signal not detecting deletions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The previous AnyAsync check used global query filters which hide soft-deleted records. Deleting a lookup sets UpdatedAt on the record (EF interceptor stamps Modified entities) but the IsDeleted filter made it invisible to the query. Added ignoreQueryFilters: true with an explicit CompanyId predicate so soft-deleted lookups are included — any deletion or edit now correctly marks the step complete. Co-Authored-By: Claude Sonnet 4.6 --- src/PowderCoating.Web/Controllers/DashboardController.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/PowderCoating.Web/Controllers/DashboardController.cs b/src/PowderCoating.Web/Controllers/DashboardController.cs index 08ffb93..a353c23 100644 --- a/src/PowderCoating.Web/Controllers/DashboardController.cs +++ b/src/PowderCoating.Web/Controllers/DashboardController.cs @@ -695,7 +695,10 @@ public class DashboardController : Controller // These share the same scoped DbContext so must run sequentially var hasStatusHistory = await _unitOfWork.JobStatusHistory.AnyAsync(_ => true); - var hasCustomizedLookups = await _unitOfWork.JobStatusLookups.AnyAsync(j => j.UpdatedAt != null); + // ignoreQueryFilters so soft-deleted lookups (UpdatedAt set on delete) are also visible + var hasCustomizedLookups = await _unitOfWork.JobStatusLookups.AnyAsync( + j => j.CompanyId == companyId && j.UpdatedAt != null, + ignoreQueryFilters: true); var teamCount = await _userManager.Users .CountAsync(u => u.CompanyId == companyId && u.IsActive && !u.IsBanned); var (_, maxUsers) = await _subscriptionService.GetUserCountAsync(companyId);