-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Fix batch updates to allow cleared values to be re-set #5686
Merged
maxkatz6
merged 16 commits into
master
from
fixes/batchupdate-set-cleared-value-end-update
Mar 28, 2021
Merged
Fix batch updates to allow cleared values to be re-set #5686
maxkatz6
merged 16 commits into
master
from
fixes/batchupdate-set-cleared-value-end-update
Mar 28, 2021
Conversation
This file contains 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
During a batch update sentinel values are written to the value store to indicate that the value needs to be removed at the end of the update. If a new value is written to the store in the course of ending the batch update, don't update this sentinel value as the value will subsequently be lost.
And a bit of a sanity check to the previous one.
- Allow adding a binding to a cleared property while ending a batch update. Need to check that the existing value isn't a remove sentinel here, otherwise the binding will be lost. - When a binding is added during the end of a batch update, `_batchUpdate` will be non-null but newly added bindings shouldn't have `BeginBatchUpdate` called on them because no `EndBatchUpdate` will arrive (as we've already called them) - Add sanity checks to the unit test to make sure that correct notifications are raised
I've asked @Michron to check if it fixes problems on our side. |
MarchingCube
approved these changes
Mar 23, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix confirmed.
To test completing/disposing bindings during and while ending batch updates.
Fixes tests in previous commit which test scenarios where bindings are completed/disposed during and when ending batch updates.
Handle changing a `Transitions` collections to new collection which contains some of the same elements. Added a comment explaining why we add new transitions before replacing old transitions; was explained in the commit message for 0694b22.
Fixes failing test from previous commit.
@MarchingCube should now also fix #5697. |
Tested again, works fine and fixes both issues 👍 |
69 tasks
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?
@MarchingCube reported a problem introduced by #5070 whereby if a property was cleared during a batch update and then re-set in the
PropertyChanged
notification raised on ending the batch update, an exception would be thrown.This was caused by our usage of sentinel values to indicate that a local value property entry needs to be removed at the end of a batch update. The fixes are:
_batchUpdate
will be non-null but newly added bindings shouldn't haveBeginBatchUpdate
called on them because noEndBatchUpdate
will arrive (as we've already called them)Update: it seems #5697 was also caused by batch updating. The
ValueStore
fix is:But it seems that batch updates also exposed some problems with transitions. Fix those:
Transitions
collections to new collection which contains some of the same elementsFixes #5697