[Revert] [iOS] CollectionView with grouped data crashes on iOS when the groups change - fix#28246
Merged
[Revert] [iOS] CollectionView with grouped data crashes on iOS when the groups change - fix#28246
Conversation
Contributor
There was a problem hiding this comment.
PR Overview
This PR reverts a regression fix for iOS that caused a blank screen when navigating back to MainPage and restores the original behavior for SR6. Key changes include:
- Adding new test cases (Issue28098) in both Shared.Tests and HostApp to validate the restored behavior.
- Updating the iOS handler in ObservableItemsSource by removing the collectionView.Window null check.
- Removing group index boundary checks in ObservableGroupedSource and deleting the old Issue27797 tests.
Reviewed Changes
| File | Description |
|---|---|
| src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue28098.cs | New test case validating the blank screen issue on navigation back. |
| src/Controls/tests/TestCases.HostApp/Issues/Issue28098.xaml.cs | New UI implementation supporting the Issue28098 test. |
| src/Controls/src/Core/Handlers/Items/iOS/ObservableItemsSource.cs | Removed the check for collectionView.Window being null. |
| src/Controls/src/Core/Handlers/Items/iOS/ObservableGroupedSource.cs | Removed boundary checks on group index values. |
| src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue27797.cs | Removed redundant tests related to the previous regression. |
| src/Controls/tests/TestCases.HostApp/Issues/Issue27797.xaml.cs | Removed redundant host app tests for the previous issue. |
Copilot reviewed 11 out of 11 changed files in this pull request and generated no comments.
Comments suppressed due to low confidence (2)
src/Controls/src/Core/Handlers/Items/iOS/ObservableItemsSource.cs:317
- Removing the check for collectionView.Window being null may lead to UI updates being attempted on a collectionView that is not attached to a window. Verify that this change does not introduce race conditions or unexpected behavior when the view is not fully loaded.
if (collectionView.Hidden)
src/Controls/src/Core/Handlers/Items/iOS/ObservableGroupedSource.cs:315
- The removal of the boundary check for the groupIndex might lead to an IndexOutOfRangeException if groupIndex is not within a valid range. Please ensure that groupIndex is always valid before accessing _groupSource.
switch (_groupSource[groupIndex])
jfversluis
approved these changes
Mar 7, 2025
Member
Author
|
/rebase |
da6f6fe to
666280a
Compare
Member
Author
|
/rebase |
666280a to
7bc65bf
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of Change
This caused a regression for SR5 so we are going to revert for now and fix the original for SR6.
Issues Fixed
Fixes #28098