fix: [DHIS2-21741] Failed event deletion is not rolled back in the UI - #4636
Merged
henrikmv merged 2 commits intoJul 2, 2026
Merged
Conversation
|
henrikmv
marked this pull request as ready for review
July 1, 2026 15:26
|
🚀 Deployed on https://deploy-preview-4636.capture.netlify.dhis2.org |
|
LGTM from QA perspective. |
dhis2-bot
added a commit
that referenced
this pull request
Jul 2, 2026
## [106.6.2](v106.6.1...v106.6.2) (2026-07-02) ### Bug Fixes * [DHIS2-21741] Failed event deletion is not rolled back in the UI ([#4636](#4636)) ([0d64927](0d64927))
Contributor
|
🎉 This PR is included in version 106.6.2 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
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.



DHIS2-21741
Simplifies the delete-event rollback mechanism in
DeleteActionModalby replacing the React Query cache lookup with a direct prop.The delete removes the event from Redux, but the rollback previously read the event data from a separate React Query cache. That cache can be stale, and newly created in-session events are not always present there, which meant rollback could be skipped on delete failure.
Previously, on mutation start the component reconstructed a query key from
teiId,programId, andenrollmentId, then dug into the cached enrollment data to find the event for rollback. Now, the already-renderedeventDetailsobject fromEventRowis passed in as a prop and used directly:This ensures the event is always available for rollback and restored on failure, including newly created in-session events.
This also removes the
useQueryClienthook, theReactQueryAppNamespaceimport, and three individual ID props in favor of a single typedeventDetails: ApiEnrollmentEventprop.