appwrite / appwrite/sdk-for-android

Realtime does not get notified or retry socket failures correctly

Open
#101 0 comments 0 reactions 1 assignee Claimed by @ChiragAgg5k View on GitHub
Dominant language
Kotlin
Stars
154
Forks
30
Avg merge
5h 41m
Merged PRs (30d)
3

Description

### 👟 Reproduction steps

1. Create a Realtime
2. Call subscribe on it
3. Background the app, but have it stay in memory (e.g. go home for 10s), or turn on airplane mode, or in some other way lose internet.

### 👍 Expected behavior

It should either:

1. Automatically attempt to reconnect the socket
2. Or at least provide a way for the client to get notified of failures.

### 👎 Actual Behavior

AppwriteWebSocketListener.onFailure is called after 5 seconds. The stack trace is printed, but the client app does not get notified.

Because onClosing isn't called, we don't automatically go through the reconnect attempt.

### 🎲 Appwrite version

Version 1.8.x

### 💻 Operating system

Linux

### 🧱 Your Environment

I'm using Kotlin io.appwrite:sdk-for-android:11.4.0

### 👀 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)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.