🐛 Bug Report: App crash on no-internet

Đang mở
#72 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
42/100
Loại issue
Lỗi
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Đình trệ
Công nghệ
android, kotlin
Lĩnh vực
mobile, networking

Hướng nghiên cứu

Bắt đầu từ đường dẫn request của Android SDK được thể hiện trong stack trace của OkHttp và tái hiện với mạng bị tắt, tập trung vào nơi UnknownHostException thoát khỏi lệnh gọi bất đồng bộ. Được xem là hoàn tất khi một request thất bại được chuyển qua đường dẫn lỗi thông thường của SDK mà không làm ứng dụng kết thúc, và trường hợp không có Internet đã được xác minh.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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)
Ngôn ngữ chính
Kotlin
Star
156
Fork
29
Merge trung bình
8 giờ 49 phút
Pull request đã merge (30 ngày)
5

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của appwrite/sdk-for-android

Tất cả issue của appwrite/sdk-for-android

Issue tương tự

Thêm issue về Kotlin

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.