fix(observables): deliver property changes on the raising thread - #105
Merged
Merged
Conversation
- A change raised on another thread waits for the running emit and is delivered on the thread that raised it. - A change raised from inside a running emit is delivered after the observer returns. - Only the binding operators move work onto the view's thread; observation operators leave threading to the caller.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #105 +/- ##
=======================================
Coverage 99.73% 99.73%
=======================================
Files 289 289
Lines 11533 11537 +4
Branches 1259 1259
=======================================
+ Hits 11502 11506 +4
Misses 18 18
Partials 13 13 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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 kind of change does this PR introduce?
Bug fix.
What is the new behavior?
WhenChanged,WhenAnyValueandWhenAnydeliver each property change on the thread that set the property.Bind,BindTwoWay,OneWayBind,BindOneWay,BindTo,BindCommand) move work onto a thread, because they connect a view to a view model.What is the current behavior?
When two threads set the same property at once, one thread delivers the other thread's changes.
What might this PR break?
None
Checklist
mainbranchAdditional information
This fixes an unintended threading change that shipped in 7.0.0 and 7.0.1 through #100.
WhenChanged,WhenAnyValueandWhenAnydeliver on.