Skip to content

Comments

Validation Context destroys self destroy before clean up#19367

Merged
nielslyngsoe merged 6 commits intorelease/16.0from
v16/hotfix/ensure-self-destroy-before-clean-up
May 21, 2025
Merged

Validation Context destroys self destroy before clean up#19367
nielslyngsoe merged 6 commits intorelease/16.0from
v16/hotfix/ensure-self-destroy-before-clean-up

Conversation

@nielslyngsoe
Copy link
Member

@nielslyngsoe nielslyngsoe commented May 20, 2025

Fix example and make sure super.destroy is handled first. And only trigger the callback with undefined once.

Copilot AI review requested due to automatic review settings May 20, 2025 08:03
Copy link
Contributor

Copilot AI left a comment

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 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) => {

@nielslyngsoe nielslyngsoe changed the title V16/hotfix/ensure self destroy before clean up Validation Context destroys self destroy before clean up May 20, 2025
@nielslyngsoe nielslyngsoe merged commit 62cedee into release/16.0 May 21, 2025
22 of 23 checks passed
@nielslyngsoe nielslyngsoe deleted the v16/hotfix/ensure-self-destroy-before-clean-up branch May 21, 2025 09:32
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.

4 participants