NativeScript / NativeScript/plugins
@nativescript/background-http high number of crashes
Ninguém assumiu esta issue ainda.
- Linguagem predominante
- TypeScript
- Estrelas
- 206
- Forks
- 123
- Merge médio
- 2d 1h
- PRs com merge (30d)
- 1
Descrição
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?
Guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Direção de pesquisa
Comece lendo packages/background-http/index.android.ts, especialmente a inicialização do canal de notificações e o estado didInit, e depois acompanhe como uma sessão é criada. Confirme se a inicialização pode ser ignorada antes de UploadService ser iniciado e use o crash relatado de UploadServiceConfig como o caso de falha; considera-se concluído quando as sessões são inicializadas de forma confiável sem esse crash.
Escrita pelo modelo de indexação a partir do texto da issue.
Avaliação
- Stack de tecnologia
- android, typescript
- Domínio
- mobile
- Tipo de issue
- Bug
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Status de atividade
- Estagnada
- Clareza
- Razoavelmente clara
- Facilidade para iniciantes
- 35/100