fix(a11y): drop assertionFailure for multiple Receivers in deferral container#621
Closed
RoyalPineapple wants to merge 2 commits into
Closed
fix(a11y): drop assertionFailure for multiple Receivers in deferral container#621RoyalPineapple wants to merge 2 commits into
RoyalPineapple wants to merge 2 commits into
Conversation
…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>
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>
e460db8 to
cb05c54
Compare
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. |
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.
Summary
Removes the
assertionFailureinAccessibilityDeferral.DeferralContainerView.updateAccessibility()that aborted debug builds when the container observed more than oneReceiver.The accompanying safe recovery — clearing each receiver's content via
apply(content: nil, frameProvider: nil)and returning early — is preserved, so the multiple-Receivercase now degrades gracefully in both debug and release. The duplicate-source-identifierassertionFailurelater in the same method is intentionally kept, since that remains a genuine misconfiguration worth flagging.Why
The
>1 Receiverstate is an expected transient, not a misconfiguration: during a reentrant Blueprint update (a forcedlayoutBelowIfNeededmid-update) the container can momentarily see both the outgoing and incomingReceiverbefore the hierarchy settles. This trapped under-Onone, crashing snapshot tests (e.g.LinkDebitCardScreenSnapshotTests.test_view()) duringBlueprintViewlayout. The settled layout pass re-runsupdateAccessibility()with the single survivingReceiver, so dropping the assertion lets the existing recovery handle the transient cleanly. This completes the trajectory of the prior commits that replaced the originalfatalErrorwithassertionFailure+ safe recovery.Changes
ReceiverassertionFailure, keeping the existing safe recovery.receivers.count <= 1guard documenting why>1is tolerated, so the assertion isn't re-added.[Main] → Fixed.