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

Debug build Assertion Failure using @ListState #503

Open
martin-maierhuber-AP opened this issue May 8, 2024 · 1 comment
Open

Debug build Assertion Failure using @ListState #503

martin-maierhuber-AP opened this issue May 8, 2024 · 1 comment

Comments

@martin-maierhuber-AP
Copy link

Hey John!

I am facing an issue debugging on an iOS 16.6.1 test device using Xcode 15.3, CoreStore 9.2.

An assertion failure is sometimes happening with updates to ListState that are covered behind a sheet.
During deinit, when removeObserver(_ observer: T) gets called in ListPublisher:164 the assertion on Thread.isMainThread is triggered because SwiftUI sometimes uses com.apple.SwiftUI.AsyncRenderer to apply view updates.

As it is just an assertion and not a general abort, it is not an issue in release builds. But for convenience check that if that might raise an issue somewhere, you can workaround the assertion failure by extending the check on Thread.isMainThread || Thread.current.name == "com.apple.SwiftUI.AsyncRenderer", if that is considered safe for you.

@JohnEstropia
Copy link
Owner

Thanks for reporting this. I'll try looking for a workaround

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants