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

SwipeView in CollectionView Faults on Windows #9423

Closed
david-maw opened this issue Aug 14, 2022 · 13 comments
Closed

SwipeView in CollectionView Faults on Windows #9423

david-maw opened this issue Aug 14, 2022 · 13 comments
Labels
area-controls-collectionview CollectionView, CarouselView, IndicatorView area-controls-swipeview SwipeView platform/windows 🪟 s/duplicate 2️⃣ This issue or pull request already exists t/bug Something isn't working
Milestone

Comments

@david-maw
Copy link

Description

My program suddenly faults with what seems to be an uncatchable exception when adding data to a list which is rendered by a CollectionView with a SwipeView inside it.

Steps to Reproduce

  1. Unzip the project from MAUIListEntry-additem.zip
  2. Build and run it under Windows debug, you should see this:
    MAUIListEntry-AddItem-1
  3. Click on the "Test" button, after a second or so Visual Studio will report an uncaught exception (it does not seem to be possible to break when this exception is thrown). What you'll see is something like this:
    MAUIListEntry-AddItem-2

Version with bug

6.0.400

Last version that worked well

Unknown/Other

Affected platforms

Windows

Affected platform versions

Windows 10

Did you find any workaround?

No

Relevant log output

No response

@david-maw david-maw added the t/bug Something isn't working label Aug 14, 2022
@jfversluis
Copy link
Member

Thanks @david-maw! The reporting of exceptions under Windows is a bit unfortunately somehow. When you get into the state of that second screenshot and you hover over the e variable (or use a Watch) you can inspect the details of the exception in there that should have the message and stack trace. Does that give you more info that you can post here?

If not, would you be able to post the reproduction as a GitHub repository? Unfortunately we can't accepted zipped reproduction projects anymore.

Thanks!

@jfversluis jfversluis added area-controls-collectionview CollectionView, CarouselView, IndicatorView platform/windows 🪟 s/needs-info Issue needs more info from the author labels Aug 15, 2022
@ghost
Copy link

ghost commented Aug 15, 2022

Hi @david-maw. We have added the "s/needs-info" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

@david-maw
Copy link
Author

Yes @jfversluis , I'd sort of hoped the UnhandledException second parameter would help, alas, not so much and I've reported the inability to break when the exception is thrown separately as a Visual Studio feedback item. Back to this problem, the exception parameter shows:
MAUIListEntry-AddItem-3
And the exception looks promising, but expanding it shows:
MAUIListEntry-AddItem-4
So either there either isn't a stack trace or I missed it, and of course "Value does not fall within the expected range" is about as helpful as you might imagine.

I've put a public repo at https://github.com/david-maw/MAUIListEntry-additem.git and I can put them there in future, I liked zip files because that put everything in the same issue but repos are fine if that works better for you.

@ghost ghost added s/needs-attention Issue has more information and needs another look and removed s/needs-info Issue needs more info from the author labels Aug 15, 2022
@david-maw
Copy link
Author

FYI, the Visual Studio bug report is here

@prom3theu5
Copy link

Also have the same

CollectionView is bound to an ObservableCollection of type LocalFile
CollectionView has a DataTemplate with a SwipeView, and RightSide swipe items, then a grid with labels in

Initial load, items load and are displayed, but cannot swipe
Navigate away and back to page, ObservableCollection is populated, but the following occurs

image

If I remove the SwipeView, the CollectionView works as expected.

@PureWeen
Copy link
Member

You might try expanding the exception to look at the stack trace to see if that reveals additional info

@PureWeen PureWeen added this to the Backlog milestone Aug 16, 2022
@PureWeen PureWeen removed the s/needs-attention Issue has more information and needs another look label Aug 16, 2022
@ghost
Copy link

ghost commented Aug 16, 2022

We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.

@prom3theu5
Copy link

prom3theu5 commented Aug 16, 2022

You might try expanding the exception to look at the stack trace to see if that reveals additional info

I did sorry just didn't include in my screenshot. It's the same as David's above, no stack track and no inner exception. It seems to occur at the point of the OnCollectionChanged firing on the observable collection.
Probably when the view tries to remove items that contain a swipe view.

@david-maw
Copy link
Author

Since I only discovered this while trying to find a workaround to #9233 I'm not sure what difference moving it to the backlog will make. So far I've had no luck at all with a SwipeView inside a CollectionView in Windows (seems ok in Android though and I have not tried any other platforms).

@prom3theu5
Copy link

prom3theu5 commented Aug 17, 2022

I've added a reproduction of it in a slimmed down project here

  • The MainViewModel loads, and populates the ObservableCollection, bound to the CollectionView.
  • Navigate to the second page with the button
  • Hit the close button on page two
  • Unhandled Error thrown with no inner exception, and no stack trace.
Entry Value
Operating System: Windows 11 21H2 Build 22000.795
IDE: Visual Studio 2022 Enterprise 17.3
Framework Version: 6.0.400
Maui Version: 6.0.486
Maui Target Framework: net6.0-windows10.0.19041.0

Also - please note, there should be two context items, but swiping the items doesn't appear to show them, as if the SwipeView isn't initialised or something?

Confirmed working fine on M1 Mac, iOS and Android. On Windows - Doesn't do anything but crash

@prom3theu5
Copy link

prom3theu5 commented Aug 18, 2022

To add to the above - I do notice in console under iOS, when navigating back to the page with the CollectionView on it after navigating to the Second Page, the console logs:

Warning: observer object was not disposed manually with Dispose()

For each item in the ObservableCollection bound to the collection view.

Its at that point on windows the crash occurs

As well as a single Warning once only: UITableView was told to layout its visible cells and other contents without being in the view hierarchy (the table view or one of its superviews has not been added to a window). This may cause bugs by forcing views inside the table view to load and perform layout without accurate information (e.g. table view bounds, trait collection, layout margins, safe area insets, etc), and will also cause unnecessary performance overhead due to extra layout passes. Make a symbolic breakpoint at UITableViewAlertForLayoutOutsideViewHierarchy to catch this in the debugger and see what caused this to occur, so you can avoid this action altogether if possible, or defer it until the table view has been added to a window. Table view: <_UIMoreListTableView on the initial load of the Main Page

@jsuarezruiz
Copy link
Contributor

Same as #8870

@jsuarezruiz jsuarezruiz added the s/duplicate 2️⃣ This issue or pull request already exists label Aug 22, 2022
@samhouts
Copy link
Member

Duplicate of #8870

@samhouts samhouts marked this as a duplicate of #8870 Aug 31, 2022
@samhouts samhouts closed this as not planned Won't fix, can't repro, duplicate, stale Aug 31, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Sep 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-controls-collectionview CollectionView, CarouselView, IndicatorView area-controls-swipeview SwipeView platform/windows 🪟 s/duplicate 2️⃣ This issue or pull request already exists t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants