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

Fixes NSInternalInconsistencyException on multiple sections update #749

Merged
merged 4 commits into from
Nov 6, 2014

Conversation

srimoyee-factory
Copy link
Contributor

If you have a table/collection view with multiple sections and the data for more than one section changes at once, it causes an NSInternalInconsistencyException. This is because CommonReactiveSource calls PerformBatchUpdates on every updated section once, but the collection/tableview expects all the updates to be batched in one call to PerformBatchUpdates.
I have a manual test case where the crash can be reproduced and this patch fixes it (I can attach the manual test case here, but couldn't figure out how to do it).

@@ -301,6 +313,52 @@ void resetupAll(IReadOnlyList<TSectionInfo> newSectionInfo)
adapter.ReloadData();
}));

disp.Add(sectionUpdatesSubject
.Buffer(TimeSpan.FromMilliseconds(125), RxApp.MainThreadScheduler)
Copy link
Member

Choose a reason for hiding this comment

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

Is there any way we can combine section and item updates? I know it'll make the code uglier, but every time we call Buffer we're kicking off timers, so we want to minimize how many we kick off

@anaisbetts
Copy link
Member

Looks good! Thanks @srimoyee-factory!

anaisbetts added a commit that referenced this pull request Nov 6, 2014
Fixes NSInternalInconsistencyException on multiple sections update
@anaisbetts anaisbetts merged commit 59aa7ae into reactiveui:master Nov 6, 2014
@lock lock bot locked and limited conversation to collaborators Jun 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants