NativeScript / NativeScript/plugins

@nativescript/background-http high number of crashes

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

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

主要言語
TypeScript
スター
206
フォーク
123
平均マージ
2日 1時間
マージ済み PR(30日)
1

説明

I am seeing a lot of crashes with java.lang.IllegalArgumentException when calling net.gotev.uploadservice.UploadServiceConfig.getNamespace

java.lang.RuntimeException: 
  at android.app.ActivityThread.handleCreateService (ActivityThread.java:4673)
  at android.app.ActivityThread.access$1700 (ActivityThread.java:301)
  at android.app.ActivityThread$H.handleMessage (ActivityThread.java:2196)
  at android.os.Handler.dispatchMessage (Handler.java:106)
  at android.os.Looper.loop (Looper.java:246)
  at android.app.ActivityThread.main (ActivityThread.java:8653)
  at java.lang.reflect.Method.invoke (Native Method)
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:602)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1130)
Caused by: java.lang.IllegalArgumentException: 
  at net.gotev.uploadservice.UploadServiceConfig.getNamespace (UploadServiceConfig.kt:74)
  at net.gotev.uploadservice.UploadServiceConfig.getBroadcastNotificationAction (UploadServiceConfig.kt:234)
  at net.gotev.uploadservice.UploadServiceConfig.getBroadcastNotificationActionIntentFilter (UploadServiceConfig.kt:248)
  at net.gotev.uploadservice.observer.request.NotificationActionsObserver.register (NotificationActionsObserver.kt:31)
  at net.gotev.uploadservice.UploadService.onCreate (UploadService.kt:194)
  at android.app.ActivityThread.handleCreateService (ActivityThread.java:4661)

Other people seem to be having this issue as well (https://github.com/Vydia/react-native-background-upload/issues/288), the proposed solution is to use net.gotev:uploadservice-okhttp:4.7.0, which background-http already uses. There are some mentions in other threads that it might be due to not creating a notification channel which is supposed to happen here https://github.com/NativeScript/plugins/blob/ca9e56ae814c670f9c603157a3fe7eb70c9bbbea/packages/background-http/index.android.ts#L8

But I suspect it's not being called reliably since it's tied to application launch.
@triniwiz does it need to be strictly called on launch? Is it okay to check didInit when creating a session and if it hasn't initialised, try to do so?

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

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

調査の方向性

まず packages/background-http/index.android.ts を読み、特に通知チャネルの初期化と didInit の状態を確認してから、セッションがどのように作成されるかを追跡します。UploadService の開始前に初期化がスキップされる可能性があるかを確認し、報告されている UploadServiceConfig のクラッシュを失敗ケースとして使用します。このクラッシュなしでセッションが確実に初期化されれば完了です。

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

評価

技術スタック
android, typescript
領域
mobile
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

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

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