Handle ApplicationExitInfo.REASON_MEMORY_LIMITER in MemoryLimiterIntegration

Abierto
#6,134 1 comentario 1 reacción 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
78/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
android, kotlin
Área
mobile

Línea de trabajo

Start in sentry-android-core/src/main/java/io/sentry/android/core/MemoryLimiterIntegration.java by reading MemoryLimiterPolicy.matches(...), then inspect sentry-android-core/src/test/java/io/sentry/android/core/MemoryLimiterIntegrationTest.kt. Add coverage for ApplicationExitInfo.REASON_MEMORY_LIMITER while preserving the REASON_OTHER plus MemoryLimiter: behavior, and verify compatibility with older SDK stubs and the existing tests.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Android Platform: Java

Summary

MemoryLimiterIntegration currently recognizes MemoryLimiter process deaths only when ApplicationExitInfo.getReason() == REASON_OTHER and the description contains the MemoryLimiter: prefix.

Android 17 / API 37.2 added ApplicationExitInfo.REASON_MEMORY_LIMITER, and our integration does not account for it yet. That means newer platform versions can report a dedicated MemoryLimiter reason that we may fail to capture.

Relevant code:

  • sentry-android-core/src/main/java/io/sentry/android/core/MemoryLimiterIntegration.java
  • sentry-android-core/src/test/java/io/sentry/android/core/MemoryLimiterIntegrationTest.kt

Android reference:

Current Behavior

MemoryLimiterPolicy.matches(...) currently returns true only when:

  • exitInfo.getReason() == ApplicationExitInfo.REASON_OTHER
  • exitInfo.getDescription() contains MemoryLimiter:

Expected Behavior

MemoryLimiterIntegration should also recognize exits reported with ApplicationExitInfo.REASON_MEMORY_LIMITER.

We should preserve current behavior for existing REASON_OTHER + MemoryLimiter: records, since older platform behavior may still surface that combination.

Acceptance Criteria

  • Update MemoryLimiterPolicy.matches(...) to handle REASON_MEMORY_LIMITER in addition to the existing legacy path.
  • Keep backward compatibility for older Android versions / SDK stubs where the new constant may not be available at compile or runtime.
  • Add regression tests covering the dedicated MemoryLimiter reason.
  • Verify existing tests around the legacy REASON_OTHER path still pass.

Notes

The implementation may need to avoid directly referencing the new constant from older compile targets if that creates compatibility issues with our current Android SDK setup.

Lenguaje dominante
Kotlin
Estrellas
1.4k
Forks
478
Merge medio
3 d 2 h
PR fusionados (30 d)
70

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de getsentry/sentry-java

Todos los issues de getsentry/sentry-java

Issues similares

Más issues de Kotlin

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.