Repository navigation
Avoid deprecated iOS tag lookup for chart commands (PRO-4970) - #21
Merged
Merged
Conversation
✅ PR Checklist Validation PassedStatus: All 2 checklist items completed 🎉 This PR meets all requirements and is ready for review! This validation ensures all PR requirements are met before merging. |
🚀 Prerelease PublishedVersion: Update package.json:"@elliottech/react-native-kline-view": "0.21.0-furkando.285ddb9.fix-ios-ref-command-dispatch"Previous prereleases for this PR have been cleaned up. This prerelease will be automatically cleaned up when the PR is merged. |
furkando
marked this pull request as ready for review
September 20, 2026 07:17
furkando
requested review from
EdiOanceaV2,
NGabuaeva,
felipe-lighter,
robertbarbu27,
rturtu and
sinantalhakosar
as code owners
September 20, 2026 07:17
🧹 Prerelease Cleanup CompleteAll prerelease versions for branch The following actions were performed:
This cleanup was performed automatically after PR merge. |
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
iOS still converts the chart ref to a numeric tag and calls
UIManager.dispatchViewManagerCommand. On Fabric that goes throughfindShadowNodeByTag_DEPRECATED, which walks the whole shadow tree on the JS thread and can race a commit from another thread. #20 removed this path on Android only.It crashed on iOS during chart testing of perps-fe-mobile #2236 (iPhone 16 Pro simulator, RN 0.86.3, debug build):
EXC_BAD_ACCESSoncom.facebook.react.runtime.JavaScriptinShadowNode::getTag<-findShadowNodeByTagRecursively<-UIManager::findShadowNodeByTag_DEPRECATED, called from a JS timer, while the main thread was inside Reanimated's worklet runtime. React Native 0.86 still ships the fix for that lookup behindfixFindShadowNodeByTagRaceCondition, off by default. The app issues about 400 chart commands in two minutes on an unauthenticated 1m chart, so the lookup runs constantly.This PR uses
codegenNativeCommandswith the current host ref on iOS as well, so no chart command resolves a numeric tag. The iOS view is a legacy view manager behind Fabric's interop layer, which resolves commands by method name (methodsByName) and prepends the view tag itself, so the nativeRCT_EXTERN_METHODsignatures, command names, argument order and payloads are unchanged.Android: no behavior change. Android already used this exact call (
Commands[name](view, ...args)); the diff only removes the platform branch around it. No native code is touched on either platform.This removes the chart's exposure to the racy lookup on iOS. It does not prove every occurrence of the intermittent crash has this cause; other libraries can still use numeric tags.
Linear ticket: PRO-4970
Validation
findNodeHandleor the legacy dispatcher.index.jspatched into perps-fe-mobile2db9f659f(Expo 57, RN 0.86.3, iPhone 16 Pro simulator, mainnet data): native KLine chart loads, appends new 1m candles and updates the live price;updateLastCandlestick,addOrderLineandremoveOrderLineall executed; no "No command found" errors, no crash. About two minutes, so this shows the commands work, not that the crash is gone.Author Checklist