Skip to content

Gate Perception suppression to debug - #390

Merged
johnnewman-square merged 1 commit into
mainfrom
johnnewman/task/debug-check
Apr 21, 2026
Merged

Gate Perception suppression to debug#390
johnnewman-square merged 1 commit into
mainfrom
johnnewman/task/debug-check

Conversation

@johnnewman-square

@johnnewman-square johnnewman-square commented Apr 15, 2026

Copy link
Copy Markdown
Contributor

This PR builds on the changes from #389.

Summary

  • gate skipPerceptionChecking behind #if DEBUG via a shared helper
  • apply the debug-only suppression to both readState and child-wrapper access(...)
  • add test_nativeOptionalChildStoreObservation so native observation covers the wrapper path through Store.access(...)
  • include the updated Samples/Tuist/Package.resolved

Why

Perception only consults skipPerceptionChecking from its debug-only checking path, so release builds do not need the TaskLocal wrapper. The new native optional-wrapper test closes the coverage gap in the path that motivated the original suppression.

Test plan

  • Ensure the new test passes
  • Look for regressions on the ObservableComposition app.

Co-authored-by: Codex <codex@openai.com>
@johnnewman-square
johnnewman-square force-pushed the johnnewman/task/debug-check branch from 2f21af4 to 9650e23 Compare April 15, 2026 17:15
@johnnewman-square
johnnewman-square marked this pull request as ready for review April 15, 2026 17:30
@johnnewman-square
johnnewman-square requested review from a team as code owners April 15, 2026 17:30
@johnnewman-square
johnnewman-square merged commit 2540e8c into main Apr 21, 2026
15 checks passed
@johnnewman-square
johnnewman-square deleted the johnnewman/task/debug-check branch April 21, 2026 19:57
johnnewman-square added a commit that referenced this pull request Jul 16, 2026
PRs #389 and #390 automatically suppressed Perception runtime warnings
on platforms using native Observation. This restores the warnings by
default while preserving an opt-in suppression path.

## Summary

- Add
`Runtime.Configuration.suppressPerceptionCheckingWhenUsingObservation`,
defaulting to `false`
- Continue normal Store access unless suppression is explicitly enabled
- Apply suppression only in debug builds on iOS 17+, macOS 14+, tvOS
17+, and watchOS 10+
- Cover both direct state reads and child Store wrapper access
- Add tests for the default warning behavior and opt-in suppression

## Test plan

- [x] Run `StoreTests` on iOS 17.5 — 25 passed
- [x] Run `StoreTests` on iOS 16.2 — passed with 8 expected skips
- [x] Run the ObservableComposition sample app on iOS 17 to ensure the
warnings are occurring by default.

## Checklist

- [x] Unit Tests
- [x] UI Tests (not applicable)
- [x] Snapshot Tests (not applicable)
- [x] I have made corresponding changes to the documentation
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.

2 participants