Repository navigation
Capture forwarded React Native button identity in AutoLogging - #313
Merged
schwartzmx merged 2 commits intoNov 16, 2026
Merged
Conversation
- Track wrapped handlers in a WeakMap associated with their owner runtime state. - Capture missing testID and element text from the first eligible forwarded descendant. - Prefer explicit outer identity and preserve label provenance and sensitivity annotations. - Refresh descendant identity on owner rerenders and independently for keyed descendants. - Preserve stable handler wrappers, application callbacks, and sibling isolation. - Accept stringifiable labels while isolating conversion failures. - Add forwarding regressions, test-app controls, and render/heap benchmarks. - Document the independent-update limitation for unkeyed same-type descendants. - Preserve public APIs and existing web implementation. Validation: - React Native tests: 121 passed. - Web AutoLogging tests: 72 passed. - React Native test-app API tests: 26 passed. - TypeScript, targeted ESLint/Prettier, build:mobile, and runtime benchmarks passed.
reshadi
approved these changes
Nov 16, 2026
Comment on lines
+155
to
+171
| if (value == null) return undefined; | ||
| if (typeof value === 'string') return value; | ||
| try { | ||
| if (typeof value !== 'number') { | ||
| if (typeof value !== 'object') return undefined; | ||
| const toString = value.toString; | ||
| if ( | ||
| typeof toString !== 'function' || | ||
| toString === Object.prototype.toString | ||
| ) | ||
| return undefined; | ||
| } | ||
| const text = String(value); | ||
| return text.length === 0 ? undefined : text; | ||
| } catch { | ||
| return undefined; | ||
| } |
Contributor
There was a problem hiding this comment.
This might be much more readable if you use a switch (typeof value). It also means you compute typeof value only once.
Member
Author
There was a problem hiding this comment.
Good call. Updated in latest push
- Accept strings, numbers, and custom-stringifiable objects without logging plain objects as labels. - Isolate failed label conversions and preserve provenance and sensitivity annotations. - Observe forwarded handlers independently of raw handler ordering in mixed controls. - Add rejection, numeric-label, and mixed-handler ordering regressions. - Document unresolved descendant lifecycle and independent unkeyed update limitations. - Preserve public APIs and web implementation. Validation: 130 React Native tests and 72 web AutoLogging tests passed; TypeScript, targeted ESLint/Prettier, mobile build, and all three runtime/heap benchmarks passed.
schwartzmx
force-pushed
the
fix/react-native-descendant-identity
branch
from
November 16, 2026 20:07
3d2e3a0 to
acfa50b
Compare
reshadi
approved these changes
Nov 16, 2026
| default: | ||
| return undefined; | ||
| } | ||
| const text = String(value); |
Contributor
There was a problem hiding this comment.
String(x) does a bunch of coercion by itself (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion).
I just noticed you're calling it here, so check if you're doing extra work that the function does anyways.
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.
Composite controls often receive an intercepted handler before forwarding it to an inner Pressable. Previously, Hyperion skipped that already-instrumented handler on the inner element, missing its explicit testID and accessibility label. Events could therefore identify only the outer component name despite meaningful identity being available inside.
7fc40dc6— Use forwarded element identity for React Native UI events3d2e3a0c— Tighten forwarded UI labels and mixed-handler identity--
npm test --workspace hyperion-react-native -- --watchman=false --runInBand --coverage=false— 130 passed; 3 benchmark tests skipped in the ordinary run.npm test --workspace hyperion-autologging -- --watchman=false --runInBand --coverage=false— 72 passed.npm run benchmark:runtime --workspace hyperion-react-native— all 3 benchmark tests passed within existing budgets.npm run build:mobile— passed, including workspace TypeScript checks and artifact validation.