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

Aperta
#582 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
32/100
Tipo di issue
Bug
Chiarezza
Da chiarire
Stato di attività
Attiva
Stack tecnologico
ios, react-native, typescript
Ambito
mobile

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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

Lingua principale
Java
Stelle
1.6k
Fork
194
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di transistorsoft/react-native-background-fetch

Tutte le issue di transistorsoft/react-native-background-fetch

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.