Found via SonarQube S2486 triage (2026-07-17), verified end-to-end.
UpdateUserCommandHandler.Handle wrapped its Keycloak PutUsersByUserIdAsync call in two empty catches — catch (ApiException) { } and catch (Exception) { } — with no log and no rethrow. So ANY failure (Keycloak down, auth failure, validation rejection, network error) was swallowed and the command completed as if it succeeded.
Impact:UserController.UpdateUser is explicitly built to handle a throwing handler — it try/catches, logs, and returns BadRequest+ProblemDetails on exception, and there's even a test UpdateUser_ReturnsBadRequest_OnException for that path. But because the handler never threw, that whole error path was DEAD CODE, and the endpoint always returned Ok("Successfully updated user") — even when the update silently failed. A user's profile change reports success and doesn't persist.
Worse, two handler tests (Update_NullUserId_DoesNotThrow, Update_InvalidKeycloakUrl_DoesNotThrow) actively PINNED the swallow behavior by asserting NotThrow — encoding the bug as the contract.
Fix (PR incoming): remove the swallowing so failures propagate to the controller (restoring the designed, already-tested behavior). Corrected the handler tests to assert failures propagate. Handler + controller suites green; slnf clean. No new risk — the controller was already written and tested for a throwing handler.
**Found via SonarQube S2486 triage (2026-07-17), verified end-to-end.**
`UpdateUserCommandHandler.Handle` wrapped its Keycloak `PutUsersByUserIdAsync` call in two empty catches — `catch (ApiException) { }` and `catch (Exception) { }` — with no log and no rethrow. So ANY failure (Keycloak down, auth failure, validation rejection, network error) was swallowed and the command completed as if it succeeded.
**Impact:** `UserController.UpdateUser` is explicitly built to handle a throwing handler — it try/catches, logs, and returns BadRequest+ProblemDetails on exception, and there's even a test `UpdateUser_ReturnsBadRequest_OnException` for that path. But because the handler never threw, that whole error path was DEAD CODE, and the endpoint always returned `Ok("Successfully updated user")` — even when the update silently failed. A user's profile change reports success and doesn't persist.
Worse, two handler tests (`Update_NullUserId_DoesNotThrow`, `Update_InvalidKeycloakUrl_DoesNotThrow`) actively PINNED the swallow behavior by asserting NotThrow — encoding the bug as the contract.
**Fix (PR incoming):** remove the swallowing so failures propagate to the controller (restoring the designed, already-tested behavior). Corrected the handler tests to assert failures propagate. Handler + controller suites green; slnf clean. No new risk — the controller was already written and tested for a throwing handler.
The fix shipped in commit 29e0a6c3fix(users): stop UpdateUserCommandHandler swallowing Keycloak failures — but its message cited #650 (a closed Reader/Perf ticket, unrelated), so this ticket stayed open. Same wrong-ticket-ref pattern as #657.
Re-verified on current master:
UpdateUserCommandHandler has no catch blocks — PutUsersByUserIdAsync failures propagate, with an in-code comment documenting why swallowing is forbidden.
The pinning tests are gone; UserHandlerTests.Update_KeycloakUnreachable_Propagates now asserts ThrowAsync (3/3 green).
UserController.UpdateUser's BadRequest-on-exception path is live again (2/2 green).
No code change required; closing as completed (fix merged, wrong ticket ref in the commit message).
**Verified fixed on master — closing.** (Skeptical re-check 2026-07-18, ticket-triage loop.)
The fix shipped in commit `29e0a6c3` *fix(users): stop UpdateUserCommandHandler swallowing Keycloak failures* — but its message cited **#650** (a closed Reader/Perf ticket, unrelated), so this ticket stayed open. Same wrong-ticket-ref pattern as #657.
Re-verified on current master:
- `UpdateUserCommandHandler` has **no catch blocks** — `PutUsersByUserIdAsync` failures propagate, with an in-code comment documenting why swallowing is forbidden.
- The pinning tests are gone; `UserHandlerTests.Update_KeycloakUnreachable_Propagates` now asserts `ThrowAsync` (3/3 green).
- `UserController.UpdateUser`'s BadRequest-on-exception path is live again (2/2 green).
No code change required; closing as completed (fix merged, wrong ticket ref in the commit message).
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Found via SonarQube S2486 triage (2026-07-17), verified end-to-end.
UpdateUserCommandHandler.Handlewrapped its KeycloakPutUsersByUserIdAsynccall in two empty catches —catch (ApiException) { }andcatch (Exception) { }— with no log and no rethrow. So ANY failure (Keycloak down, auth failure, validation rejection, network error) was swallowed and the command completed as if it succeeded.Impact:
UserController.UpdateUseris explicitly built to handle a throwing handler — it try/catches, logs, and returns BadRequest+ProblemDetails on exception, and there's even a testUpdateUser_ReturnsBadRequest_OnExceptionfor that path. But because the handler never threw, that whole error path was DEAD CODE, and the endpoint always returnedOk("Successfully updated user")— even when the update silently failed. A user's profile change reports success and doesn't persist.Worse, two handler tests (
Update_NullUserId_DoesNotThrow,Update_InvalidKeycloakUrl_DoesNotThrow) actively PINNED the swallow behavior by asserting NotThrow — encoding the bug as the contract.Fix (PR incoming): remove the swallowing so failures propagate to the controller (restoring the designed, already-tested behavior). Corrected the handler tests to assert failures propagate. Handler + controller suites green; slnf clean. No new risk — the controller was already written and tested for a throwing handler.
Verified fixed on master — closing. (Skeptical re-check 2026-07-18, ticket-triage loop.)
The fix shipped in commit
29e0a6c3fix(users): stop UpdateUserCommandHandler swallowing Keycloak failures — but its message cited #650 (a closed Reader/Perf ticket, unrelated), so this ticket stayed open. Same wrong-ticket-ref pattern as #657.Re-verified on current master:
UpdateUserCommandHandlerhas no catch blocks —PutUsersByUserIdAsyncfailures propagate, with an in-code comment documenting why swallowing is forbidden.UserHandlerTests.Update_KeycloakUnreachable_Propagatesnow assertsThrowAsync(3/3 green).UserController.UpdateUser's BadRequest-on-exception path is live again (2/2 green).No code change required; closing as completed (fix merged, wrong ticket ref in the commit message).