Skip to content

fix: defer ObservedSatisfies publications - #80

Merged
SoundBlaster merged 2 commits into
mainfrom
fix/observed-satisfies-view-update-publish
Sep 22, 2026
Merged

SoundBlaster merged 2 commits into
mainfrom
fix/observed-satisfies-view-update-publish

Conversation

@SoundBlaster

Copy link
Copy Markdown
Owner

Goal

Prevent the SwiftUI runtime warning Publishing changes from within view updates is not allowed when @ObservedSatisfies is wired during DynamicProperty.update().

Changes

  • Evaluate the initial specification value while constructing the observer, before SwiftUI begins reconciling the view.
  • Keep update() limited to installing the Combine subscription; it no longer mutates @Published synchronously.
  • Defer publisher-driven evaluations to the next main-queue turn before assigning the published value.
  • Add regression assertions that the initial wrapped value is available immediately after initialization.

Validation

  • swiftc -frontend -parse Sources/SpecificationKit/Wrappers/ObservedSatisfies.swift — passed.
  • git diff --check — passed.
  • swift test --filter ObservedSatisfiesTests was attempted on Xcode 27 but is blocked by an unrelated existing FirstMatchSpec.Builder ambiguous initializer error in Sources/SpecificationKit/Specs/FirstMatchSpec.swift:238.

Boundaries and follow-ups

This PR is limited to ObservedSatisfies. SessionMonitor must consume a released SpecificationKit version containing this fix before the warning disappears from its remote package checkout.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 22, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-22T12:32:06.618893Z cd95666 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cd95666552

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread Sources/SpecificationKit/Wrappers/ObservedSatisfies.swift
@SoundBlaster
SoundBlaster merged commit d81e7f8 into main Sep 22, 2026
3 checks passed
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