Skip to content

fix(a11y): drop assertionFailure for multiple Receivers in deferral container#621

Closed
RoyalPineapple wants to merge 2 commits into
mainfrom
RoyalPineapple/remove-receiver-assertion
Closed

fix(a11y): drop assertionFailure for multiple Receivers in deferral container#621
RoyalPineapple wants to merge 2 commits into
mainfrom
RoyalPineapple/remove-receiver-assertion

Conversation

@RoyalPineapple

@RoyalPineapple RoyalPineapple commented Jun 17, 2026

Copy link
Copy Markdown
Collaborator

Summary

Removes the assertionFailure in AccessibilityDeferral.DeferralContainerView.updateAccessibility() that aborted debug builds when the container observed more than one Receiver.

The accompanying safe recovery — clearing each receiver's content via apply(content: nil, frameProvider: nil) and returning early — is preserved, so the multiple-Receiver case now degrades gracefully in both debug and release. The duplicate-source-identifier assertionFailure later in the same method is intentionally kept, since that remains a genuine misconfiguration worth flagging.

Why

The >1 Receiver state is an expected transient, not a misconfiguration: during a reentrant Blueprint update (a forced layoutBelowIfNeeded mid-update) the container can momentarily see both the outgoing and incoming Receiver before the hierarchy settles. This trapped under -Onone, crashing snapshot tests (e.g. LinkDebitCardScreenSnapshotTests.test_view()) during BlueprintView layout. The settled layout pass re-runs updateAccessibility() with the single surviving Receiver, so dropping the assertion lets the existing recovery handle the transient cleanly. This completes the trajectory of the prior commits that replaced the original fatalError with assertionFailure + safe recovery.

Changes

  • Remove the multiple-Receiver assertionFailure, keeping the existing safe recovery.
  • Add a comment on the receivers.count <= 1 guard documenting why >1 is tolerated, so the assertion isn't re-added.
  • Add a CHANGELOG entry under [Main] → Fixed.

…ontainer

The receivers.count <= 1 guard already recovers safely by clearing
receiver content and returning early. The assertionFailure traps under
-Onone (e.g. snapshot tests), crashing instead of degrading gracefully.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@RoyalPineapple RoyalPineapple marked this pull request as ready for review June 17, 2026 08:39
@RoyalPineapple RoyalPineapple requested a review from a team as a code owner June 17, 2026 08:39
Add a comment on the receivers.count <= 1 guard documenting that >1 is an
expected transient state during reentrant Blueprint updates (so the
assertion isn't re-added), and record the assertion removal in CHANGELOG.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@RoyalPineapple RoyalPineapple force-pushed the RoyalPineapple/remove-receiver-assertion branch from e460db8 to cb05c54 Compare June 17, 2026 08:57
@RoyalPineapple

Copy link
Copy Markdown
Collaborator Author

🤖 Closing in favor of #620 (Rob's fix), which makes the same assertionFailure removal and adds a regression test for the duplicate-receiver case. Consolidating on that one.

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