fix(macos): stop config tests counting unrelated notifications#103481
Merged
Conversation
Contributor
Author
|
Current-head verification for
Root-cause proof: Foundation's NotificationCenter contract defines a nil observer object as accepting any sender. The same-name sender probe produced Landing remains intentionally held behind #103393 and the remaining #103427 fix in #103457. After both land, update once onto current |
steipete
force-pushed
the
codex/fix-configstore-notification-flake
branch
from
July 10, 2026 10:37
12949ab to
da2009f
Compare
Contributor
Author
|
Land-ready proof for exact head
Known proof gaps: none. |
Contributor
Author
|
Merged via squash.
|
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Jul 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #103477
Related: #102637
What Problem This Solves
The macOS Swift suite could fail
ConfigStoreTestswhen another publisher emitted the same config-change notification during the focused save assertion. The failure was timing-dependent: the original exact-head macOS run observed two notifications on its first attempt, then passed on retry.Why This Change Was Made
Production keeps its existing sender contract:
ConfigStorestill posts.openclawConfigDidChangewith a nil object onNotificationCenter.default. The focused tests now inject a private notification center through the existing DEBUG-only test overrides and deliberately race a competing nil-sender notification on the default center. This proves the save success path announces exactly once, the failure path does not announce, and the production nil-sender contract remains unchanged. A shared override helper also guarantees cleanup on both successful and throwing test paths.User Impact
There is no user-visible behavior change. This is a test-robustness change that removes cross-test notification contamination without weakening the assertions.
Evidence
ConfigStoreTests.swift:60becausechangeCountwas 2 instead of 1; the automatic retry passed.ConfigStoreandAppStateboth publish.openclawConfigDidChangewith a nil sender, whileSettingsRootViewintentionally subscribes without a sender filter. Foundation documents that a nil observer object accepts notifications from any sender.pnpm check:changedpassed on leasetbx_01kx5sc6mejkzymc4qvxaq7j3g: all five selected lanes passed (171 tests passed, 37 skipped).swiftc -frontend -parsepassed for both touched Swift files.swiftformat --lint --config config/swiftformatpassed for both touched Swift files.git diff --check origin/main...HEADpassed.29d018f0af5e92ff1c131f08dd9308e6c9e38e59was clean with no accepted/actionable findings.da2009f015437c759cd5bba3ab97fcce822d4fb6, including macos-swift job 86342723880: lint, release build, dependency trait check, and the first full Swift test attempt passed with 781 tests in 123 suites. macos-node, native-i18n, security-fast, and preflight also passed.Exact-head PR macOS CI is the authoritative full Swift build/test proof.
AI-assisted: diagnosis, implementation, and validation were prepared with Codex; the linked issue and hosted failure provide the original evidence.