🐛 Bug Report: App crash on no-internet

Aperta
#72 0 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
42/100
Tipo di issue
Bug
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
android, kotlin
Ambito
mobile, networking

Direzione di ricerca

Inizia dal percorso della richiesta dell’Android SDK rappresentato dallo stack trace di OkHttp e riproduci il problema con la rete disabilitata, concentrandoti sul punto in cui UnknownHostException esce dalla chiamata asincrona. Il lavoro è completato quando una richiesta non riuscita viene gestita tramite il normale percorso degli errori dell’SDK senza terminare l’app e il caso senza Internet è stato verificato.

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

Descrizione

bug
👟 Reproduction steps

I'm not able to consistently reproduce this but whenever there is network issues and the SDK tries to make a request it crashes the whole app itself rather than catching the exception

         Fatal Exception: java.net.UnknownHostException: Unable to resolve host "cloud.appwrite.io": No address associated with hostname
               at java.net.Inet6AddressImpl.lookupHostByName(Inet6AddressImpl.java:156)
               at java.net.Inet6AddressImpl.lookupAllHostAddr(Inet6AddressImpl.java:103)
               at java.net.InetAddress.getAllByName(InetAddress.java:1152)
               at okhttp3.Dns$Companion$DnsSystem.lookup(Dns.kt:1)
               at okhttp3.internal.connection.RouteSelector.resetNextInetSocketAddress(RouteSelector.java:413)
               at okhttp3.internal.connection.RouteSelector.nextProxy(RouteSelector.java:413)
               at okhttp3.internal.connection.RouteSelector.next(RouteSelector.java:413)
               at okhttp3.internal.connection.ExchangeFinder.findConnection(ExchangeFinder.kt:413)
               at okhttp3.internal.connection.ExchangeFinder.findHealthyConnection(ExchangeFinder.kt:413)
               at okhttp3.internal.connection.ExchangeFinder.find(ExchangeFinder.kt:60)
               at okhttp3.internal.connection.RealCall.initExchange$okhttp(RealCall.java:60)
               at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.kt:60)
               at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:1)
               at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.kt:156)
               at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:1)
               at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.kt:235)
               at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:1)
               at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.kt:149)
               at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:1)
               at okhttp3.internal.connection.RealCall.getResponseWithInterceptorChain$okhttp(RealCall.kt:100)
               at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:48)
               at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
               at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
               at java.lang.Thread.run(Thread.java:1012)

### 👍 Expected behavior

Should not crash the app but rather catch the exception

### 👎 Actual Behavior

Crashes the app

### 🎲 Appwrite version

io.appwrite:sdk-for-android:6.0.0

### 💻 Operating system

Android 

### 🧱 Your Environment

_No response_

### 👀 Have you spent some time to check if this issue has been raised before?

- [x] I checked and didn't find similar issue

### 🏢 Have you read the Code of Conduct?

- [x] I have read the [Code of Conduct](https://github.com/appwrite/.github/blob/main/CODE_OF_CONDUCT.md)
Lingua principale
Kotlin
Stelle
156
Fork
29
Merge medio
8h 49m
PR unite (30g)
5

Preparare l'ambiente

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 appwrite/sdk-for-android

Tutte le issue di appwrite/sdk-for-android

Issue simili

Altre issue su Kotlin

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.