Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow nested BindingNotifications. #15722

Merged
merged 3 commits into from
May 14, 2024

Conversation

grokys
Copy link
Member

@grokys grokys commented May 14, 2024

What does the pull request do?

When the binding system refactor (#13970) was written, a check was added to ensure that nested BindingNotifications didn't happen, and the refactor was written with the assumption that they wouldn't happen.

The problem is that they do happen: when a source object implements both INotifyDataErrorInfo and had data annotations, then the nested data validation plugins would each wrap the value coming from the previous plugin in a new BindingNotification, resulting in nested BindingNotifications.

This adds support for nested binding notifications back in - even though IMO nesting binding notifications is a bug, if we're doing it and we previously supported it then we should continue to support it.

Fixed issues

Fixes #15201

grokys added 2 commits May 14, 2024 15:11
When #13970 was written, [a check](https://github.com/AvaloniaUI/Avalonia/pull/13970/files#diff-cfb25a491b9452e1815aa2c0d71465aaf81e99792a88a04a1a2ed572fd1930ffR60) was added to ensure that nested `BindingNotification`s didn't happen, and the refactor was written with the assumption that they wouldn't happen.

The problem is that they _do_ happen: when a source object implements both `INotifyDataErrorInfo` and had data annotations, then the nested data validation plugins would each wrap the value coming from the previous plugin in a new `BindingNotification`, resulting in nested `BindingNotifications`.

This adds support for nested binding notifications back in - even though IMO nesting binding notifications is a bug, if we're doing it and we previously supported it then we should continue to support it.

Fixes #15201
@grokys grokys added bug backport-candidate-11.1.x Consider this PR for backporting to 11.1 branch labels May 14, 2024
@avaloniaui-bot
Copy link

You can test this PR using the following package version. 11.2.999-cibuild0048457-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@grokys grokys enabled auto-merge May 14, 2024 14:52
@grokys grokys added this pull request to the merge queue May 14, 2024
Merged via the queue into master with commit 5e323b8 May 14, 2024
11 checks passed
@grokys grokys deleted the fixes/15201-datavalidation-stackoverflow branch May 14, 2024 21:05
grokys added a commit that referenced this pull request Jun 3, 2024
* Added failing test for #15201.

* Handle nested BindingNotifications.

When #13970 was written, [a check](https://github.com/AvaloniaUI/Avalonia/pull/13970/files#diff-cfb25a491b9452e1815aa2c0d71465aaf81e99792a88a04a1a2ed572fd1930ffR60) was added to ensure that nested `BindingNotification`s didn't happen, and the refactor was written with the assumption that they wouldn't happen.

The problem is that they _do_ happen: when a source object implements both `INotifyDataErrorInfo` and had data annotations, then the nested data validation plugins would each wrap the value coming from the previous plugin in a new `BindingNotification`, resulting in nested `BindingNotifications`.

This adds support for nested binding notifications back in - even though IMO nesting binding notifications is a bug, if we're doing it and we previously supported it then we should continue to support it.

Fixes #15201
@grokys grokys added backported-11.1.x and removed backport-candidate-11.1.x Consider this PR for backporting to 11.1 branch labels Jun 3, 2024
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.

11.1.0-beta1 stackoverflow on property set (SetProperty), works in 11.0.10
3 participants