Skip to content

fix: defer reentrant BlueprintView updates#618

Draft
robmaceachern wants to merge 1 commit into
mainfrom
robmaceachern/defer-reentrant-safe-area-layout
Draft

fix: defer reentrant BlueprintView updates#618
robmaceachern wants to merge 1 commit into
mainfrom
robmaceachern/defer-reentrant-safe-area-layout

Conversation

@robmaceachern

Copy link
Copy Markdown
Member

Summary

  • defer BlueprintView hierarchy invalidations that occur while Blueprint is already updating its view tree
  • coalesce the deferred retry so UIKit safe-area/window callbacks cannot synchronously re-enter updateViewHierarchyIfNeeded()
  • add a regression test that mutates additionalSafeAreaInsets during backing-view attach/layout, matching the production crash shape
  • add the missing BlueprintUICommonControls dependency for the package test target so the focused package test builds

Context

This came from an ios-register 7.10 crash investigation where BlueprintView.safeAreaInsetsDidChange() re-entered BlueprintView.updateViewHierarchyIfNeeded() during a Market keyboard/header layout update. A MarketUI harness reproduced the exact precondition crash locally before this Blueprint patch; with this patch copied into Market's Blueprint checkout, the same harness passes.

Testing

  • xcodebuild test -scheme BlueprintUI-Package -destination 'platform=iOS Simulator,name=iPhone 17 Pro,OS=26.5' -only-testing:BlueprintUITests/BlueprintViewTests/test_safeAreaChangeDuringUpdateDefersNestedUpdate -quiet
  • Market validation with this Blueprint source copied into Market's local checkout: xcodebuild test -workspace ios/MarketDevelopment.xcworkspace -scheme UnitTests -destination 'platform=iOS Simulator,name=iPhone 17 Pro,OS=26.5' -only-testing:MarketUI-Tests/MarketKeyboardReaderReentrantLayoutTests/test_safeAreaChangeDuringKeyboardReaderUpdateDoesNotReenterBlueprint -quiet

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