Skip to content

Conversation

pyrtsa
Copy link
Contributor

@pyrtsa pyrtsa commented Aug 6, 2025

Here's another case of failing perception checks for where TCA, SwiftUI, UIKit, and Combine meet.

Because the store is first accessed inside makeUIView(_:context:), the isSwiftUI() check inside Perception considers it as valid.

But publishers seem to mix very unwell with ObservableState here… Not only should accessing state.count inside the sink { ... } call be free of perception checks: because state is just a struct (mostly!) and as such a snapshot of whatever state the store was in at the time of the publisher emitting a value, accessing its value members shouldn't even touch the observation/perception machinery, I think. Or why should it?

In any case, this is an example of the runtime warnings we started getting when attempting to upgrade to the latest Point-Free library versions.

@pyrtsa pyrtsa force-pushed the uiviewrepresentable-publisher-perception branch from b4fef5f to a39c73f Compare August 29, 2025 19:34
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

Successfully merging this pull request may close these issues.

1 participant