E2E user deletion cleanup returns BadRequest for Viewer #416

Open
opened 2026-11-13 18:15:22 +01:00 by arnaud.dartois · 4 comments
Owner

Summary

The Gitea Build and tests job fails in Heimdall.E2E.Tests.Pages.UserManagementTests.User_created_from_dialog_can_log_in_with_submitted_password_after_email_confirmation. The account creation, email confirmation, and login assertions pass, but the test cleanup receives HTTP 400 from DELETE /api/users/{id} for a Viewer account.

Current evidence

  • Run 1033: 46 E2E tests passed; one Viewer cleanup failed with deleteResponse.StatusCode equal to BadRequest.
  • Run 1034: the same Viewer cleanup fails after the test has successfully logged in; the E2E job is finishing.
  • The failing code path is the test's final cleanup assertion at tests/Heimdall.E2E.Tests/Pages/UserManagementTests.cs:107.
  • No error response body is currently included, so the exact application reason still needs diagnosis.

Scope

Reproduce the Viewer deletion response in the disposable E2E database, identify whether the endpoint or test cleanup setup is wrong, and fix the underlying cause without weakening user deletion authorization or silently accepting a failed cleanup.

Acceptance

  1. Capture a sanitized error reason from the failing DELETE response.
  2. Fix the application or test setup at its source and add focused coverage.
  3. Run all four role/order permutations in the browser test successfully.
  4. Run the relevant disposable database/Compose acceptance and preserve the last-admin/self-delete protections.

Owner and prerequisites

Heimdall Web/identity maintainers. Requires the normal Gitea CI browser-test environment with the disposable PostgreSQL database and Chromium.

Focused workflow: skills/gitea-ticket-workflow/SKILL.md, skills/compose-disposable-recipe/SKILL.md.

## Summary The Gitea Build and tests job fails in `Heimdall.E2E.Tests.Pages.UserManagementTests.User_created_from_dialog_can_log_in_with_submitted_password_after_email_confirmation`. The account creation, email confirmation, and login assertions pass, but the test cleanup receives HTTP 400 from `DELETE /api/users/{id}` for a Viewer account. ## Current evidence - Run 1033: 46 E2E tests passed; one Viewer cleanup failed with `deleteResponse.StatusCode` equal to BadRequest. - Run 1034: the same Viewer cleanup fails after the test has successfully logged in; the E2E job is finishing. - The failing code path is the test's final cleanup assertion at `tests/Heimdall.E2E.Tests/Pages/UserManagementTests.cs:107`. - No error response body is currently included, so the exact application reason still needs diagnosis. ## Scope Reproduce the Viewer deletion response in the disposable E2E database, identify whether the endpoint or test cleanup setup is wrong, and fix the underlying cause without weakening user deletion authorization or silently accepting a failed cleanup. ## Acceptance 1. Capture a sanitized error reason from the failing DELETE response. 2. Fix the application or test setup at its source and add focused coverage. 3. Run all four role/order permutations in the browser test successfully. 4. Run the relevant disposable database/Compose acceptance and preserve the last-admin/self-delete protections. ## Owner and prerequisites Heimdall Web/identity maintainers. Requires the normal Gitea CI browser-test environment with the disposable PostgreSQL database and Chromium. Focused workflow: `skills/gitea-ticket-workflow/SKILL.md`, `skills/compose-disposable-recipe/SKILL.md`.
arnaud.dartois added the area:cipriority:P2type:bug labels 2026-11-13 18:15:22 +01:00
Author
Owner

Suite à l’échec isolé de nettoyage User viewer par HTTP 400 (CI run #1034), le run complet suivant #1036 a passé 47/47 tests E2E, y compris les quatre permutations d’ordre viewer/supervisor. Un run ciblé local a aussi passé 4/4. Aucun affaiblissement d’assertion n’a été fait; seuls des diagnostics d’échec expurgés ont été ajoutés dans PR #415. La cause racine du HTTP 400 initial n’a pas été reproduite, donc le ticket reste ouvert jusqu’à diagnostic ou répétitions CI concluantes.

Suite à l’échec isolé de nettoyage User viewer par HTTP 400 (CI run #1034), le run complet suivant #1036 a passé 47/47 tests E2E, y compris les quatre permutations d’ordre viewer/supervisor. Un run ciblé local a aussi passé 4/4. Aucun affaiblissement d’assertion n’a été fait; seuls des diagnostics d’échec expurgés ont été ajoutés dans PR #415. La cause racine du HTTP 400 initial n’a pas été reproduite, donc le ticket reste ouvert jusqu’à diagnostic ou répétitions CI concluantes.
Author
Owner

CI follow-up (2026-11-14): run 1041 attempt 1 on PR head 74623d6 completed with Build and tests failing in the final E2E browser suite: 46/47 passed. The failing Viewer role/order permutation completed account creation, email confirmation and login, then DELETE /api/users/{id} returned HTTP 400 {"error":"ConcurrencyFailure"} from test cleanup. All Agent/API/Application/Domain/Infrastructure/Integration/Web suites passed; the CI policy job failed only because required validation failed. I reran the same exact head (run 1041 attempt 2) to determine whether this is intermittent; result pending. No application or test behavior change is claimed yet. Existing UserManagementTests.cs changes only sanitize/report this cleanup response.

CI follow-up (2026-11-14): run 1041 attempt 1 on PR head 74623d6 completed with Build and tests failing in the final E2E browser suite: 46/47 passed. The failing Viewer role/order permutation completed account creation, email confirmation and login, then DELETE /api/users/{id} returned HTTP 400 `{"error":"ConcurrencyFailure"}` from test cleanup. All Agent/API/Application/Domain/Infrastructure/Integration/Web suites passed; the CI policy job failed only because required validation failed. I reran the same exact head (run 1041 attempt 2) to determine whether this is intermittent; result pending. No application or test behavior change is claimed yet. Existing `UserManagementTests.cs` changes only sanitize/report this cleanup response.
Author
Owner

CI follow-up: run 1041 attempt 2 passed on exact PR head 74623d6a326d11ba26d33e392a5de94690b3c67f. Browser tests and all other validation jobs passed, including Central, CPU Agent and NVIDIA Agent image builds/scans; CI policy passed. The first attempt's Viewer cleanup returned HTTP 400 ConcurrencyFailure, but the same four role/order browser permutations passed on retry without code changes, indicating an intermittent concurrency result rather than a deterministic failure. This issue remains open until we establish and address the underlying concurrency condition; this PR adds sanitized failure diagnostics and does not claim that concurrency behavior is fixed. External hardware/deployment limits remain as already documented.

CI follow-up: run 1041 attempt 2 passed on exact PR head `74623d6a326d11ba26d33e392a5de94690b3c67f`. Browser tests and all other validation jobs passed, including Central, CPU Agent and NVIDIA Agent image builds/scans; CI policy passed. The first attempt's Viewer cleanup returned HTTP 400 `ConcurrencyFailure`, but the same four role/order browser permutations passed on retry without code changes, indicating an intermittent concurrency result rather than a deterministic failure. This issue remains open until we establish and address the underlying concurrency condition; this PR adds sanitized failure diagnostics and does not claim that concurrency behavior is fixed. External hardware/deployment limits remain as already documented.
Author
Owner

Completion record (2026-11-14): PR #415 merged as 383205b9fce1104ff184654e735762868d4de926. Release workflow run 1043 passed all checks and published Heimdall 1.0.8: https://sources.tordais.cc/arnaud.dartois/Heimdall/releases/tag/1.0.8. Assets include signed update manifest/signature, CPU and GPU image metadata, public key, installer archive, portable Agent archive, and checksum. The first PR CI attempt had one sanitized Viewer cleanup ConcurrencyFailure; rerun attempt 2 passed all browser permutations and all required jobs without code changes. This issue remains open because the intermittent concurrency root cause is not proven fixed; do not infer a production deletion defect from the single transient failure. Validation is synthetic CI only.

Completion record (2026-11-14): PR #415 merged as `383205b9fce1104ff184654e735762868d4de926`. Release workflow run 1043 passed all checks and published Heimdall 1.0.8: https://sources.tordais.cc/arnaud.dartois/Heimdall/releases/tag/1.0.8. Assets include signed update manifest/signature, CPU and GPU image metadata, public key, installer archive, portable Agent archive, and checksum. The first PR CI attempt had one sanitized Viewer cleanup `ConcurrencyFailure`; rerun attempt 2 passed all browser permutations and all required jobs without code changes. This issue remains open because the intermittent concurrency root cause is not proven fixed; do not infer a production deletion defect from the single transient failure. Validation is synthetic CI only.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: arnaud.dartois/Heimdall#416