[Bug]: Generic "Error: 1" in Sentry

Abierto
#582 2 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
32/100
Tipo de issue
Error
Claridad
Necesita aclaración
Estado de actividad
Activo
Stack tecnológico
ios, react-native, typescript
Área
mobile

Línea de trabajo

Start with the promise behavior of BackgroundFetch.configure on iOS, as the reporter describes it, and compare it with the documented return values of 0, 1 and 2. Decide whether configure should resolve with the status or reject, and settle that with maintainers before writing code. Done means the chosen behavior is documented and a test or sample shows the rejected case is caught.

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

Descripción

bug
Required Reading
  • Confirmed
Plugin Version

4.4.2

Mobile operating-system(s)
  • iOS
  • Android
Device Manufacturer(s) and Model(s)

any iOS device (SE, 15, 17)

Device operating-systems(s)

iOS 26 + 13% other

React Native / Expo version

RN86

What happened?

6 years of "Error: 1" in Sentry. Never dug into it - till now w/ AI.

Image Image

Long story short. We followed doc sample, but best I understand iOS devices will only ever return status=2 from that await as anything else is rejected in the promise and not caught.

So it explains why our Sentry filled over 6 years with these rare, but impossible to triage errors since its a bare rejection from native with no stacktrace.

We adapted to this

    try {
      await BackgroundFetch.configure(...)
    } catch {
      // Status is read below
    }

    try {
      const status = await BackgroundFetch.status()
      // etc

Wouldn't it be cool since the docs suggest reading the status from .configure that it could return 0,1 or 2? Or should it never do that and instead reject and we handle in userland? Just seems like we stumbled upon the source of the error, but don't have best idea on fix and we were just following doc recommendation.

Plugin Code and/or Config
let status = await BackgroundFetch.configure({
    minimumFetchInterval: minimumFetchInterval,
    stopOnTerminate: false,
    startOnBoot: true,
    requiredNetworkType: BackgroundFetch.NETWORK_TYPE_ANY,
    requiresBatteryNotLow: true,
  }, async (taskId) => {
    BackgroundFetchCallBack();
    BackgroundFetch.finish(taskId);
  }, async (taskId) => {
    BackgroundFetch.finish(taskId);
  });
Relevant log output

Lenguaje dominante
Java
Estrellas
1.6k
Forks
194
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

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 transistorsoft/react-native-background-fetch

Todos los issues de transistorsoft/react-native-background-fetch

Issues similares

Más issues de Java

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.