Skip to content

Fix user edit modal failing when creator or modifier is soft-deleted#25557

Merged
EngincanV merged 1 commit into
rel-10.4from
maliming/fix-edit-modal-soft-deleted-creator
Jun 5, 2026
Merged

Fix user edit modal failing when creator or modifier is soft-deleted#25557
EngincanV merged 1 commit into
rel-10.4from
maliming/fix-edit-modal-soft-deleted-creator

Conversation

@maliming

@maliming maliming commented Jun 5, 2026

Copy link
Copy Markdown
Member

The Identity Users edit modal returned 404 when the user's creator or last modifier had been soft-deleted: GetUserNameOrNullAsync calls IIdentityUserAppService.GetAsync which throws on a missing user, so opening the modal failed and the error referenced the deleted creator's id instead of the user being edited.

Adds IIdentityUserAppService.FindByIdAsync (null-safe lookup, same pattern as FindByUsernameAsync / FindByEmailAsync) and switches the edit modal to use it. Now a soft-deleted creator/modifier just shows as blank instead of breaking the page.

Fixes #25555

Copilot AI review requested due to automatic review settings June 5, 2026 02:26
@maliming maliming added this to the 10.4-patch milestone Jun 5, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses an MVC Identity UI bug where opening Users → Edit fails (404) if the edited user’s CreatorId or LastModifierId references a soft-deleted user. It does so by introducing a null-safe “find” API and switching the edit modal to use it so missing audit users render blank instead of breaking the page.

Changes:

  • Added FindByIdAsync(Guid id) to IIdentityUserAppService and implemented it in IdentityUserAppService.
  • Updated the MVC edit modal to resolve CreatedBy/ModifiedBy via FindByIdAsync and tolerate missing users.
  • Updated HTTP API + generated client proxies and added application tests for the new method.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
modules/identity/test/Volo.Abp.Identity.Application.Tests/Volo/Abp/Identity/IdentityUserAppService_Tests.cs Adds tests validating FindByIdAsync returns user/null (including soft-delete).
modules/identity/src/Volo.Abp.Identity.Web/wwwroot/client-proxies/identity-proxy.js Updates generated JS proxies to include findById.
modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Users/EditModal.cshtml.cs Switches audit username resolution to null-safe lookup (FindByIdAsync).
modules/identity/src/Volo.Abp.Identity.HttpApi/Volo/Abp/Identity/IdentityUserController.cs Exposes GET api/identity/users/by-id/{id} endpoint.
modules/identity/src/Volo.Abp.Identity.HttpApi.Client/ClientProxies/Volo/Abp/Identity/IdentityUserClientProxy.Generated.cs Updates generated C# client proxy with FindByIdAsync.
modules/identity/src/Volo.Abp.Identity.HttpApi.Client/ClientProxies/identity-generate-proxy.json Updates proxy generation metadata for the new endpoint.
modules/identity/src/Volo.Abp.Identity.Application/Volo/Abp/Identity/IdentityUserAppService.cs Implements FindByIdAsync using UserManager.FindByIdAsync.
modules/identity/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/IIdentityUserAppService.cs Adds FindByIdAsync to the public app service interface.

@maliming maliming requested a review from EngincanV June 5, 2026 02:38
@codecov

codecov Bot commented Jun 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 49.38%. Comparing base (9e63359) to head (025e9c4).

Additional details and impacted files
@@             Coverage Diff              @@
##           rel-10.4   #25557      +/-   ##
============================================
- Coverage     49.41%   49.38%   -0.04%     
============================================
  Files          3674     3671       -3     
  Lines        124021   123853     -168     
  Branches       9477     9466      -11     
============================================
- Hits          61280    61159     -121     
+ Misses        60919    60877      -42     
+ Partials       1822     1817       -5     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@EngincanV EngincanV merged commit 6b34f9c into rel-10.4 Jun 5, 2026
4 of 6 checks passed
@EngincanV EngincanV deleted the maliming/fix-edit-modal-soft-deleted-creator branch June 5, 2026 05:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants