Skip to content

Recover from duplicate accessibility deferral receivers#620

Merged
robmaceachern merged 2 commits into
mainfrom
robmaceachern/fix-accessibility-deferral-duplicates
Jun 17, 2026
Merged

Recover from duplicate accessibility deferral receivers#620
robmaceachern merged 2 commits into
mainfrom
robmaceachern/fix-accessibility-deferral-duplicates

Conversation

@robmaceachern

Copy link
Copy Markdown
Member

Summary

Fixes the duplicate accessibility deferral receiver recovery path so it clears deferred content without triggering a DEBUG assertion. This matches the existing recovery behavior while avoiding the crash seen when integrating Blueprint 6.7.2 downstream.

Also wires BlueprintUIAccessibilityCoreTests into Package.swift, so the accessibility core regression tests run through the package scheme.

Root Cause

AccessibilityDeferral.ParentContainer already had recovery logic for multiple receivers, but it called assertionFailure first. In DEBUG builds, that turned the recoverable duplicate-receiver state into a fatal test crash for consumers such as squareup/ios-register#153221.

Validation

  • Reproduced the failure before the fix with:
    xcodebuild test -scheme BlueprintUI-Package -destination 'id=C4028877-CBF8-4816-88AD-B9C88E490FB1' -only-testing:BlueprintUIAccessibilityCoreTests/AccessibilityDeferralTests/test_parentContainerWithDuplicateReceiversClearsDeferralContent
  • Passed after the fix:
    xcodebuild test -scheme BlueprintUI-Package -destination 'id=C4028877-CBF8-4816-88AD-B9C88E490FB1' -only-testing:BlueprintUIAccessibilityCoreTests
  • Passed:
    mise x -- swiftformat --lint .

I also ran the full BlueprintUI-Package suite locally. The new accessibility core target and main Blueprint tests passed, but the full run still exited failing on unrelated BlueprintUICommonControlsTests snapshot reference gaps for local iOS 18 output and one existing measurement expectation.

@RoyalPineapple RoyalPineapple left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Confirmed multiple Receivers in one deferral container is a valid, intended configuration e.g. a card field whose number/expiry/CVV/ZIP subfields are each receivers, so the container should recover gracefully instead of asserting.

Comment thread BlueprintUIAccessibilityCore/Sources/AccessibilityDeferral.swift
@robmaceachern robmaceachern marked this pull request as ready for review June 17, 2026 14:31
@robmaceachern robmaceachern requested a review from a team as a code owner June 17, 2026 14:31
@robmaceachern robmaceachern merged commit 3e651e7 into main Jun 17, 2026
11 checks passed
@robmaceachern robmaceachern deleted the robmaceachern/fix-accessibility-deferral-duplicates branch June 17, 2026 14:40
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.

3 participants