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

オープン
#582 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
32/100
issue の種類
バグ
明瞭さ
説明が足りない
活発さ
活発
技術スタック
ios, react-native, typescript
領域
mobile

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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

主要言語
Java
スター
1.6k
フォーク
194
PR マージ指標
30日以内にマージされた PR はありません

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

transistorsoft/react-native-background-fetch のほかの issue

transistorsoft/react-native-background-fetch の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。