Validation Context destroys self destroy before clean up#19367
Merged
nielslyngsoe merged 6 commits intorelease/16.0from May 21, 2025
Merged
Validation Context destroys self destroy before clean up#19367nielslyngsoe merged 6 commits intorelease/16.0from
nielslyngsoe merged 6 commits intorelease/16.0from
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR ensures that the self destroy process in the validation controller triggers the base class destroy routine before performing additional cleanup, and updates observable subscriptions to use the new observe method for consistent reactive handling.
- Moved the call to super.destroy() to the beginning of the destroy() method in the validation controller.
- Replaced direct subscribe calls with this.observe in the validation dashboard for improved subscription management.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/Umbraco.Web.UI.Client/src/packages/core/validation/controllers/validation.controller.ts | Reorders the destroy method to call super.destroy() before performing cleanup, eliminating a duplicate call. |
| src/Umbraco.Web.UI.Client/examples/validation-context/validation-context-dashboard.ts | Updates observable subscriptions to use this.observe instead of subscribe. |
Comments suppressed due to low confidence (1)
src/Umbraco.Web.UI.Client/examples/validation-context/validation-context-dashboard.ts:51
- [nitpick] Verify that using 'this.observe' integrates correctly with your subscription management to ensure proper unsubscription and avoid potential memory leaks.
this.observe(this.validation.messages.messagesOfPathAndDescendant('$.form'), (value) => {
src/Umbraco.Web.UI.Client/src/packages/core/validation/controllers/validation.controller.ts
Show resolved
Hide resolved
madsrasmussen
approved these changes
May 20, 2025
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.
Fix example and make sure super.destroy is handled first. And only trigger the callback with undefined once.