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

Fix trackable beforeId bug. #208

Merged
merged 1 commit into from
Jun 6, 2017
Merged

Conversation

edhager
Copy link
Contributor

@edhager edhager commented Jun 1, 2017

Note: the bug only affected a collection that did not have a query executor.

In Trackable on a put, the notify code removes the item from its tracking arrays and then tries to update the arrays with the item's new location. Before when the beforeId was the item's id, the item was removed from the tracking arrays. When the code tried to add the item back to the tracking arrays, it was not added because the item referenced by beforeId was not found.

This fix recognizes when the beforeId item is removed and when the item is to be reinserted into the tracking arrays, it now follows the same path as an update without using the beforeId option.

Fix #207.

@edhager edhager requested a review from maier49 June 1, 2017 22:34
Copy link
Contributor

@maier49 maier49 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, and I double checked that it fixes the issue as well.

@edhager edhager merged commit a563c6d into dojo:master Jun 6, 2017
@edhager edhager deleted the trackable-beforeId-fix branch June 6, 2017 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Trackable event incorrect when beforeId matched item being updated
2 participants