Conversation
When called with isUserSoftDeleted=false, the DeleteWidgetModal opens with soft-delete as the default and a post-mount setFieldsValue effect seeds the form. A fast click on the hard-delete radio can land before that effect runs and gets overwritten, making the app fire the soft-delete API call instead of hard-delete — the test then waits forever for a hardDelete=true response and times out. Wait for the default soft-delete radio to be checked before switching, so the click and the effect no longer race. Surfaces consistently in UserCreationWithPersona.spec.ts which is the only caller passing isUserSoftDeleted=false and does not gate on the show-deleted toggle response beforehand. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
Code Review ✅ ApprovedUpdates permanentDeleteUser to handle non-soft-deleted states, stabilizing end-to-end test execution. No issues found. OptionsDisplay: compact → Showing less information. Comment with these commands to change:
Was this helpful? React with 👍 / 👎 | Gitar |
Rohit0301
approved these changes
Apr 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
UserCreationWithPersona.spec.ts→Create user with persona and verify on profiletimes out consistently in nightly on1.12.6. Network trace shows the app firingDELETE /api/v1/users/{id}?hardDelete=false&recursive=false(soft delete) even though the test clicks the hard-delete radio — so thewaitForResponse('...?hardDelete=true&...')never resolves and the 60s test timeout hits.Why
DeleteWidgetModalusesdestroyOnClose, so its Form remounts with empty state each time the modal opens. AuseEffect([visible])then seedsdeleteType = SOFT_DELETEviaform.setFieldsValue. If Playwright clicks[data-testid="hard-delete"]between the Form's mount-render and the effect running, the effect fires after the click and overwrites the selection back toSOFT_DELETE. On Confirm, the app callsdeleteEntity(..., deleteType === HARD_DELETE)withfalse.This only surfaces when
permanentDeleteUser(…, isUserSoftDeleted=false)is used. Every other caller passestrue, which triggers awaitForResponse('/api/v1/users?**include=non-deleted')on the show-deleted toggle before the modal ever opens, buying enough time for the effect to run.UserCreationWithPersona.spec.tsis the only caller that doesn't — hence the consistent failure there while Users / UserDetails / OnlineUsers / PersonaFlow etc. stay green.Fix
Test-only change: before clicking hard-delete, wait for
[data-testid="soft-delete"].ant-radio-wrapper-checked— the signal thatsetFieldsValuehas finished seeding the form. The wait is gated on!isUserSoftDeletedbecause when the show-deleted toggle is on, the modal'sallowSoftDelete=falseso there's no soft-delete radio to wait for (and no race — the default is already HARD_DELETE).Product-side fix (replace the effect with
initialValueson the Form so the default is set synchronously on mount) belongs onmain; this PR just unblocks1.12.6nightly without touching shipped code.Test plan
UserCreationWithPersona.spec.tsacross multiple shardsUsers.spec.ts,UserDetails.spec.ts,OnlineUsers.spec.ts,PersonaFlow.spec.ts,PersonaDeletionUserProfile.spec.tsstill green (they hit theisUserSoftDeleted=truebranch which is unchanged)🤖 Generated with Claude Code