fix(binding): reapply cached source values during UpdateTarget - #21756
Merged
MrJul merged 2 commits intoJul 20, 2026
Merged
Conversation
UpdateTarget did not restore an uncommitted explicit two-way target value when the source still matched the binding expression's cached value. Equal-value suppression then prevented ValueStore from receiving the refresh.\n\nTrack the synchronous UpdateTarget rebuild and force publication only for that path, so the source value is reapplied without changing normal binding notification deduplication. The preceding regression test covers the observable behavior in both reflection and compiled binding paths.
|
You can test this PR using the following package version. |
MrJul
pushed a commit
that referenced
this pull request
Jul 29, 2026
* Added failing test for #21746. * fix(binding): reapply cached source values during UpdateTarget UpdateTarget did not restore an uncommitted explicit two-way target value when the source still matched the binding expression's cached value. Equal-value suppression then prevented ValueStore from receiving the refresh.\n\nTrack the synchronous UpdateTarget rebuild and force publication only for that path, so the source value is reapplied without changing normal binding notification deduplication. The preceding regression test covers the observable behavior in both reflection and compiled binding paths. --------- Co-authored-by: grokys <grokys@users.noreply.github.com>
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.
What does the pull request do?
Fixes #21746. Restores the documented UpdateTarget contract for explicit two-way bindings when a target edit has not been written to the source.
What is the current behavior?
After a target is changed under UpdateSourceTrigger=Explicit, UpdateTarget rebuilds the binding path but does not restore the unchanged source value. The binding expression already caches that value, so equal-value suppression prevents the value store from receiving a refresh and the target remains edited.
What is the updated/expected behavior with this PR?
UpdateTarget re-applies the source value even when it matches the expression cache. Calling it after an uncommitted explicit two-way target edit now restores the target from the source without modifying the source.
How was the solution implemented (if it's not obvious)?
The binding tracks the synchronous UpdateTarget rebuild and forces value publication only while that rebuild is in progress. Normal binding notification deduplication is unchanged. A counter and finally block keep the state correct for nested calls and exceptions.
Checklist
Breaking changes
None.
Obsoletions / Deprecations
None.
Fixed issues
Fixes #21746
Validation
The focused regression runs in both the reflection and compiled paths.