Skip to content

fix(ios): warn on leftover transform/opacity in Fabric view recycling - #32

Draft
kosmydel wants to merge 1 commit into
0.86.0-discordfrom
kosmydel/add-guards
Draft

fix(ios): warn on leftover transform/opacity in Fabric view recycling#32
kosmydel wants to merge 1 commit into
0.86.0-discordfrom
kosmydel/add-guards

Conversation

@kosmydel

Copy link
Copy Markdown

Description

DEBUG-only tripwire in prepareForRecycle for the Fabric recycle-pool leak class: native code stamps layer.transform / layer.opacity outside props, Fabric reuses the view, and updateProps diffs identity against identity and skips the write. Warns instead of resetting so the native call site can be fixed.

Test steps

  1. DEBUG iOS: open/close chat with the keyboard up, New Message (select then remove a user), inverted beginning row. Investigate any [FabricRecycleLeak] warning — leftover transform/opacity should be reset on unmount or the component opted out via +shouldBeRecycled.
  2. Confirm the guard fires: stamp a non-identity layer.transform on a View whose props are identity, recycle it, and check for [FabricRecycleLeak] in the console. Release builds should not log.

Note

This does not sanitize the layer. Warnings are the signal to fix the root cause, not a production safety net.

Made with Cursor

Native layer writes bypass props, so updateProps can skip the rewrite on
reuse. Detect this in DEBUG without resetting the layer so call sites can
be fixed.

Co-authored-by: Cursor <cursoragent@cursor.com>
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