Skip to content

Fix DNS preference continuation leak#3

Merged
offyotto merged 1 commit into
mainfrom
codex/fix-dns-preference-continuations
Jun 6, 2026
Merged

Fix DNS preference continuation leak#3
offyotto merged 1 commit into
mainfrom
codex/fix-dns-preference-continuations

Conversation

@offyotto

@offyotto offyotto commented Jun 5, 2026

Copy link
Copy Markdown
Owner

Summary

  • fixes the SWIFT TASK CONTINUATION MISUSE: loadFromPreferences() leaked its continuation log by avoiding the ambiguous async preference wrapper
  • adds a guarded continuation box for DNS proxy preference load/save operations
  • adds a 10-second timeout with a useful entitlement/provisioning error instead of leaving Apply/Revert suspended forever
  • ignores late callbacks after timeout so continuations cannot be resumed twice

Notes

The other logs in the report (AppleLanguages, linkd.autoShortcut, tab indexing, task name port) appear to be framework or runtime noise from macOS/SwiftPM app launching rather than Locale-owned code paths. This PR fixes the app-owned continuation leak that can hang DNS proxy preference updates.

Validation

  • swift test
  • ./script/build_and_run.sh --build-only on the original branch before cherry-picking this focused fix

@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: 0ea1e83aa7

ℹ️ 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".

}

func scheduleTimeout() {
DispatchQueue.main.asyncAfter(deadline: .now() + 10) { [weak self] in

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Retain the timeout operation until it fires

When loadFromPreferences/saveToPreferences never invoke or retain the completion handler, the only reference left to PreferenceOperationContinuation is this weak capture, so it can be deallocated before the 10-second deadline and the timeout block returns without resuming the checked continuation. That leaves Apply/Revert suspended and preserves the continuation leak in exactly the entitlement/provisioning failure path this change is trying to handle; the timeout closure needs to keep the operation alive until it either fires or an earlier callback clears the continuation.

Useful? React with 👍 / 👎.

@offyotto offyotto merged commit f40da94 into main Jun 6, 2026
1 check passed
@offyotto offyotto deleted the codex/fix-dns-preference-continuations branch June 6, 2026 17:59
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