sdk-for-android
sdk-for-android copied to clipboard
🐛 Bug Report: Realtime create socket mutlitimes!
👟 Reproduction steps
https://github.com/appwrite/sdk-for-android/blob/85fac9dedd90eefe8407382cdd9f54b436862703/library/src/main/java/io/appwrite/services/Realtime.kt#L116-L123
when call this job in multiple threads ,it may call createSocket twice times or more?
👍 Expected behavior
when call this job in multiple threads ,it may call createSocket once. It will be ok by this code .
private var subCallDepth = AtomicInteger(0)
delay(DEBOUNCE_MILLIS)
if (subCallDepth.compareAndSet(0,1)) {
createSocket()
}
👎 Actual Behavior
it may call createSocket twice times or more?
🎲 Appwrite version
Appwrite Cloud
💻 Operating system
Linux
🧱 Your Environment
android
👀 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