WIP: Turbo Modules crash time context #6227
2 issues
find-bugs: Found 2 issues (2 low)
Low
`popTurboModuleCall` clears scope context while another active call on the same scope remains in the stack - `packages/core/src/js/index.ts:162`
In popTurboModuleCall (turboModuleTracker.ts:155), after popping a call the code only compares the immediate new top-of-stack frame to the popped frame's scope. If a deeper frame in the stack still references the popped frame's scope, clearScope(popped.scope) still runs, erasing contexts.turbo_module and the turbo_module.* tags for a call that is still in flight. A subsequent crash captured during that still-active call would therefore be missing the TurboModule call context this integration is meant to provide.
Also found at:
packages/core/src/js/turbomodule/turboModuleTracker.ts:155-159packages/core/src/js/turbomodule/index.ts:3
callId leaked on stack when `result.then()` throws synchronously - `packages/core/src/js/turbomodule/wrapTurboModule.ts:85-97`
If isThenable passes but result.then(onFulfilled, onRejected) throws synchronously (e.g. a custom thenable whose then getter or invocation throws), callId is pushed via pushTurboModuleCall and never popped, leaving a stale turbo_module context on the Sentry scope indefinitely.
⏱ 20m 48s · 2.5M in / 201.8k out · $5.46