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
@stephencelis stephencelis marked this pull request as ready for review October 14, 2025 23:38
@stephencelis stephencelis changed the title Add failing test using store.publisher in makeUIView Skip perception checks in Store.publisher Oct 14, 2025
@stephencelis stephencelis merged commit ae2515f into pointfreeco:main Oct 15, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants