Android: turbo_module.* crash tags permanently pinned to RNSentry.initNativeReactNavigationNewFrameTracking (promise never settles)
Los mantenedores suelen responder en 1 día
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 78/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- android, react-native, typescript
- Área
- mobile
Línea de trabajo
Lee android/src/main/java/io/sentry/react/RNSentryModuleImpl.java y compara initNativeReactNavigationNewFrameTracking con la implementación de iOS en ios/RNSentry.mm. Comprueba cómo se gestionan los métodos que devuelven Promises en src/js/turbomodule/wrapTurboModule.ts; el issue también sugiere auditar otros métodos que reciben Promises en RNSentryModuleImpl. Se considera terminado cuando esta llamada ya no deja atascado un frame del tracker y el comportamiento de Android coincide con la resolución prevista de la Promise.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Summary
On Android, the crash-time TurboModule attribution added in #6227 is permanently pinned to a single startup call. Every native crash report from an Android app carries:
turbo_module.name: RNSentry
turbo_module.method: initNativeReactNavigationNewFrameTracking
regardless of what was actually executing. The tags are not stale-by-a-moment; they are stuck for the entire process lifetime, so the feature reports a wrong answer rather than no answer. iOS is unaffected.
Cause
Three facts compose:
-
wrapTurboModulepops a tracker frame for a promise-returning method only when that promise settles (src/js/turbomodule/wrapTurboModule.ts— theisThenable(result)branch pops in boththenhandlers). -
The Android implementation never settles the promise:
// android/src/main/java/io/sentry/react/RNSentryModuleImpl.java public void initNativeReactNavigationNewFrameTracking(Promise promise) { this.initFragmentInitialFrameTracking(); }promiseis accepted and dropped — noresolve, noreject, no path that settles it later. iOS does the equivalent work and then callsresolve(nil)(ios/RNSentry.mm). -
RNSENTRY_SKIPinturboModuleContextIntegrationdoes not include this method, so it is wrapped like any other.
The frame pushed at startup therefore never pops. popTurboModuleCall walks the stack and re-syncs the scope onto "the newest remaining frame on the same scope" after every subsequent pop — which, once the app is idle, is always the leaked startup frame. The native scope is left holding it, and sentry-java serialises it into every crash report.
Two smaller consequences of the same leak: the tracker stack never drains to empty (so clearScope's empty-string sentinel path is unreachable on Android), and the aggregate record for that call is never emitted.
Steps to reproduce
- Expo app on Android with
enableTimeToInitialDisplayon (expoRouterIntegrationorreactNavigationIntegration). - Let the app finish starting, navigate anywhere, idle.
- Trigger any native crash — e.g.
Sentry.nativeCrash()— or readgetTurboModuleCallStack(). - The event's tags report
RNSentry.initNativeReactNavigationNewFrameTrackingas the in-flight call; the stack still holds that frame.
Suggested fix
Settle the promise in the Android implementation, mirroring iOS:
public void initNativeReactNavigationNewFrameTracking(Promise promise) {
this.initFragmentInitialFrameTracking();
promise.resolve(null);
}
Adding the method to RNSENTRY_SKIP would hide the symptom but leave the dangling promise, so the native-side fix seems the right one. It may be worth auditing the other Promise-taking methods in RNSentryModuleImpl for the same shape.
Versions
@sentry/react-native: reproduced on 8.27.0; the Android code is unchanged on 8.29.0 (current latest)- Platform: Android only (iOS resolves correctly)
- Lenguaje dominante
- TypeScript
- Estrellas
- 1.8k
- Forks
- 369
- Merge medio
- 23 h 27 min
- PR fusionados (30 d)
- 112
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de getsentry/sentry-react-native
-
React-Native Replays Task
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
getsentry/sentry-react-native#6680 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Improvement React-Native
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
getsentry/sentry-react-native#6143 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
React-Native Task User Feedbacks
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
getsentry/sentry-react-native#5932 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
React-Native Replays Task
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
getsentry/sentry-react-native#5882 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Good First Issue React-Native Task
Dificultad 1/5 Menos de una hora Aptitud para principiantes 65/100
getsentry/sentry-react-native#5771 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de getsentry/sentry-react-native
Issues similares
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
-
area:cowork area:desktop documentation enhancement platform:macos
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
anthropics/claude-code#101720 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
apache/rocketmq-dashboard#6610 ·
Los mantenedores suelen responder en 3 días
-
Add: MS NOWAbiertocheck:passed streams:add
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
Los mantenedores suelen responder en 1 día
-
Global update drops overrideAccess, so Local API updateGlobal fails filterOptions validation (3.90 regression)Posiblemente ocupada @PINYOPATTANAWASANPORN la tomó hoy. Abiertoarea: core Bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
payloadcms/payload#18674 · 1 comentario ·
Los mantenedores suelen responder en 1 día