🐛 Bug Report: Realtime create socket mutlitimes!

オープン
#62 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
55/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
android, kotlin
領域
mobile

調査の方向性

Realtime.kt の 116-123 行から始め、並行呼び出しがどのように createSocket() に到達するかを調べます。複数のスレッドからサブスクリプション呼び出しを再現し、その後、1 つの並行リクエストで作成されるソケットが 1 つだけであり、期待されるリアルタイム動作が維持されることを確認します。

索引モデルが issue の本文から書いたものです。

説明

bug
👟 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?
  • I checked and didn't find similar issue
🏢 Have you read the Code of Conduct?
主要言語
Kotlin
スター
156
フォーク
29
平均マージ
8時間 49分
マージ済み PR(30日)
5

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

appwrite/sdk-for-android のほかの issue

appwrite/sdk-for-android の issue をすべて見る

似ている issue

Kotlin の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。