-
Notifications
You must be signed in to change notification settings - Fork 360
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
IOS-699: fix crash on deletion of access method #6287
IOS-699: fix crash on deletion of access method #6287
Conversation
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 crash happens when the snapshot tries to reload items during removal. In updateDataSource
we create a new snapshot and simultaneously populate and reload items from the repository. It seems the snapshot then crashes when it tries to compare the new items (3) to the old (4), making the index go out of range. A slight guess, but in a "pure" removal there is no comparison made and therefore no crash. Also, adding and reloading at the same time seems to be fine, since nothing is removed and range remains "safe".
The solution here - although more cumbersome - would be to avoid reloading when removing items. It was put there to make sure that non-destructive changes to existing api methods (eg. name change) would be propagated back to the list.
Reviewed 1 of 1 files at r1, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved
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.
Reviewed 1 of 1 files at r2, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved
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.
Reviewable status: complete! all files reviewed, all discussions resolved
22bfece
to
c4d789a
Compare
🚨 End to end tests failed. Please check the failed workflow run. |
ListAccessMethodViewController
's data source was getting out of sync withfetchedItems
, which was caused by reloading items (useful when existing items have changed, catastrophic for when items have been removed from the middle of the list). Only reloading if the number of items is the same fixes the issue.This change is