-
Notifications
You must be signed in to change notification settings - Fork 74
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 a host crash in LazyListUpdateProcessor #2177
Conversation
I introduced a bug in the mechanism that attempts to replace animated inserts and removes with update-in-place transitions. The crash occurs when the before window shrinks while the total number of elements is growing. The previous code naively assumed the before window shrinking would always be a scroll, but it can coincide with a content change. Closes: #2172
processor.items.insert(6, "I") | ||
processor.onEndChanges() | ||
processor.scrollTo(0, 12) | ||
assertThat(processor.toString()).isEqualTo(". . C D E Fv2 G H I . . .") |
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.
The v2
after F
here means there was an update-in-place, rather than a structural change. I’d like to do a follow-up to make these all say v2
, which is how we reduce the glitchy animations in update processing.
processor.itemsAfter(2) | ||
processor.onEndChanges() | ||
processor.scrollTo(0, 12) | ||
assertThat(processor.toString()).isEqualTo(". . . Cv2 D E F G H I . .") |
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.
Same v2 thing.
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.
Good catch!
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.
Thanks for the quick fix! The tests look great!
I introduced a bug in the mechanism that attempts to replace animated inserts and removes with update-in-place transitions.
The crash occurs when the before window shrinks while the total number of elements is growing. The previous code naively assumed the before window shrinking would always be a scroll, but it can coincide with a content change.
Closes: #2172
CHANGELOG.md
's "Unreleased" section has been updated, if applicable.