Using animateExtraColumnName and having the RealmResults is sorted by the same column as animateExtraColumnName, there is the potential for a single row to have a change in animateExtraColumnName that will also change its row position.
If this occurs then the diff delta will be a INSERT and DELETE for that row.
If the insert is done first then the delete will be on the incorrect row. The result being that the original row will still be visible unchanged, the updated row will have then replaced an unrelated row at the new position.
Example of what can occur.
index
primarykey
animateExtraColumn
0
abc
100
1
xyz
75
2
123
50
3
ijk
20
Before (RealmResults sorted DESC on animateExtraColumn)
index
primarykey
animateExtraColumn
0
abc
100
1
123
90
2
123
50
3
ijk
20
After (primary key row 123 has had its animate column incremented to 90)
This pull request re-sorts the delta's to ensure the DELETE takes place before the INSERT.
Documentation is also updated for the use of animateExtraColumnName.
Using animateExtraColumnName and having the RealmResults is sorted by the same column as animateExtraColumnName, there is the potential for a single row to have a change in animateExtraColumnName that will also change its row position.
If this occurs then the diff delta will be a INSERT and DELETE for that row. If the insert is done first then the delete will be on the incorrect row. The result being that the original row will still be visible unchanged, the updated row will have then replaced an unrelated row at the new position.
Example of what can occur.
Before (RealmResults sorted DESC on animateExtraColumn)
After (primary key row 123 has had its animate column incremented to 90)
This pull request re-sorts the delta's to ensure the DELETE takes place before the INSERT.
Documentation is also updated for the use of animateExtraColumnName.