Skip to content

Fix explicit closure captures for Swift 6.4 - #332

Draft
marcbodea wants to merge 1 commit into
mainfrom
agent/swift-6-4-compatibility
Draft

marcbodea wants to merge 1 commit into
mainfrom
agent/swift-6-4-compatibility

Conversation

@marcbodea

Copy link
Copy Markdown
Collaborator

Summary

Restore make check with Apple Swift 6.4 by making the existing strong self captures explicit in the recording-start callback and the error-toast callback. The nested Combine subscriber and delayed toast dismissal retain their weak captures.

Why

Swift 6.4 diagnoses an implicitly strong outer capture followed by a weak inner capture as ImplicitStrongCapture. Current main stops at the recording-start callback; correcting that exposes the same diagnostic in the toast callback. These two declarations preserve the existing ownership behavior and keep macOS 13 support.

Verification

  • make check on Apple Silicon with Apple Swift 6.4, targeting macOS 13: passed, including all deterministic tests and repository validation
  • make ARCH=x86_64 typecheck: passed
  • git diff --check: passed
  • No new unit test: this is a compiler compatibility correction directly exercised by the full production type-check; a source-text assertion would only duplicate the implementation
  • Manual app verification completed

Manual verification: not run. Before merge, verify recording start and live audio-level updates, stop/cancel behavior, and a synthetic error toast that dismisses after six seconds without an older timer dismissing a newer toast. No app launch, permission changes or live-provider calls were performed during validation.

Existing AVAudioConverter Sendable availability warnings remain under the installed SDK. They are nonfatal in both checks and are outside this capture-only change; no warnings were suppressed.

Independent read-only review found no blocking issues and confirmed that the strong outer and weak inner capture lifetimes are preserved.

Risk and privacy

  • No real API keys, audio, transcripts, screenshots, selected text, clipboard contents, window titles or private provider URLs are included
  • Data sent to providers is unchanged
  • Credential and Keychain behavior is unchanged
  • macOS permissions and entitlements are unchanged
  • Preferences and pipeline-history compatibility are unchanged
  • Signing, notarization, updates and GitHub workflows are unchanged

Risk is limited to explicit capture declarations in existing recording/UI callbacks. No microphone API, screenshot/context construction, clipboard or storage behavior changes. No migration, version change or release is included. Reverting this commit restores the prior declarations.

@coderabbitai

coderabbitai Bot commented Sep 28, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant