Skip to content

[APP-3834] Backport react-native#59748: stop Content Capture rebuilding accessibility subtrees - #12354

Draft
mozzius wants to merge 2 commits into
mainfrom
samuel/app-3834-backport-rn-59748
Draft

mozzius wants to merge 2 commits into
mainfrom
samuel/app-3834-backport-rn-59748

Conversation

@mozzius

@mozzius mozzius commented Nov 8, 2026 •

Copy link
Copy Markdown
Member

Backports react/react-native#59748 (react/react-native#59748), which fixes the UI-thread stalls described in react/react-native#59743 (react/react-native#59743).

What happens. On Pixels running Android 16 and 17, Content Capture builds an AccessibilityNodeInfo on the UI thread for every view that appears. This happens even with no accessibility service on; every app gets a session through Android's scam detection.

Why RN makes it expensive. For RN views, each of those calls lands in ReactAccessibilityDelegate.getTalkbackDescription. That function initializes each child's node, then calls itself with null, which builds and initializes the same node again, all the way down. The cost grows exponentially with nesting depth.

Measured cost.

  • The issue measured 100–280 ms freezes when a screen re-appears.
  • While profiling the Home feed's list on a Pixel 7a (APP-3833), Content Capture was 20–25% of the main thread while scrolling, and RN's text accessibility delegate alone was about 14%.

The fix is one line: pass the node the loop already initialized.

  • In 0.88.1, createNodeInfoFromView is exactly obtain() plus onInitializeAccessibilityNodeInfo, the same thing the loop just did. getTalkbackDescription copies the node it's given and never recycles it, so the descriptions don't change.
  • The PR's 8-level test fixture goes from 511 node initializations to 9.

Notes:

  • The upstream PR is still open; patches/react-native/pr-59748-1e10181fc9.patch.md has the removal TODO.
  • The lockfile change is only the react-native patch_hash and the peer-suffix hashes derived from it. No versions changed.

Test plan

  • Android build on a Pixel (Android 17): profile a screen pop and Home feed scrolling with simpleperf. getTalkbackDescription recursion should be gone from the Content Capture path.
  • TalkBack on: spot-check that pressables and post rows announce the same text as before.

🤖 Generated with Claude Code

…ubtrees

APP-3834

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@linear-code

linear-code Bot commented Nov 8, 2026

Copy link
Copy Markdown

APP-3834

@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown
Contributor
Size Old size New size Diff
Uncompressed 9.76 MB 9.76 MB 0 B (0.00%)
Gzip 2.86 MB 2.86 MB 0 B (0.00%)

@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

The OTA deployment for this PR was successful! You may now apply it by either scanning the QR code or opening the deep link below in your browser:

QR code for the PR OTA deployment

bluesky://intent/apply-ota?channel=pull-request-12354&releaseVersion=1.138.0&iosBuildNumber=2270&androidBuildNumber=1705

@arcalinea
arcalinea temporarily deployed to samuel/app-3834-backport-rn-59748 - social-app PR #12354 November 8, 2026 09:06 — with Render Destroyed
Android builds react native from source in every build since #12024.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch was successfully deployed

1 active deployment
samuel/app-3834-backport-rn-59748 - social-app PR #12354 — 6e51a5df Deployed Nov 8, 2026 by arcalinea
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.

2 participants