Realtime messages can come out of order (and in fact are processed in parallel)
@ChiragAgg5k ci sta già lavorando.
Dal 24/2/2026.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
👟 Reproduction steps
- In Kotlin, create a
Realtimesubscription. - Trigger multiple messages (for example, createOperations and create multiple items at the same time)
- Observe they are not ordered, but are processed in parallel.
In my code, I used a callbackFlow to convert the callback to a flow, so I essentially processed them sequentially, but due to the callback, they don't necessarily enter the queue in order.
Note: this does not happen all the time, so repeated attempts to reproduce may be required before it occurs. Best way is to ensure multiple updates come at the same time and are ordered in a fashion that's easy to notice (such as an increasing text field or something).
Note in Realtime.kt, AppwriteWebSocketListener onMessage, when it receives a message, it performs launch(IO) to handle the response event. This means each message gets scheduled to run in parallel, which means the messages are not serialized per subscriber.
👍 Expected behavior
I expect to get my callback called in the order of messages I get from the server, and not have parallel callbacks, as I might reasonably expect updates to be processed in order.
Alternatively and perhaps better, I would like to have the API expose the server messages as a Flow<RealtimeResponse> instead of a callback model.
👎 Actual Behavior
Actual behavior is the messages can come in arbitrary order. Often they're in order but not always. Here's some example logging output:
2026-01-04 20:44:48.717 22217-22295 D Got an item id=A
2026-01-04 20:44:48.722 22217-29657 D Got an item id=C
2026-01-04 20:44:48.725 22217-22291 D Got an item id=B
Note the process ID is the same 22217 but the thread id is different for each message.
For reference, in another (web) client, I got:
A $createdAt=2026-01-05T04:44:50.074+00:00 timestamp=2026-01-05T04:44:50.095+00:00
B $createdAt=2026-01-05T04:44:50.078+00:00 timestamp=2026-01-05T04:44:50.100+00:00
C $createdAt=2026-01-05T04:44:50.078+00:00 timestamp=2026-01-05T04:44:50.105+00:00
🎲 Appwrite version
Version 1.8.x
💻 Operating system
Linux
🧱 Your Environment
This is using the Android Kotlin library io.appwrite:sdk-for-android:11.4.0
👀 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?
- I have read the Code of Conduct
- Lingua principale
- Kotlin
- Stelle
- 156
- Fork
- 29
- Merge medio
- 8h 49m
- PR unite (30g)
- 5
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di appwrite/sdk-for-android
-
Realtime does not get notified or retry socket failures correctlyForse di nuovo libera @ChiragAgg5k l’ha presa 267 giorni fa e non c’è nessuna pull request aperta. Aperta
appwrite/sdk-for-android#101 · 1 assegnatario ·
-
Support mTLSForse di nuovo libera @ChiragAgg5k l’ha presa 267 giorni fa e non c’è nessuna pull request aperta. Aperta
appwrite/sdk-for-android#100 · 1 commento · 1 assegnatario ·
-
Compose MultiplatformAperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
appwrite/sdk-for-android#99 · 1 commento · 1 reazione ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 52/100
appwrite/sdk-for-android#96 ·
-
🐛 Bug Report: Cookie ErrorApertabug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
appwrite/sdk-for-android#80 · 1 commento ·
Tutte le issue di appwrite/sdk-for-android
Issue simili
-
Unified account interface not translated into Simplified ChineseForse già presa @xuenhua l’ha presa 2 giorni fa. Apertaunconfirmed
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
thunderbird/thunderbird-android#11936 · 1 commento ·
I maintainer di solito rispondono entro 3 giorni
-
Update toast stylingApertadesign good first issue help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 73/100
scribe-org/Scribe-Android#778 ·
I maintainer di solito rispondono entro 1 giorno
-
Needs Triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
ankidroid/Anki-Android#23392 ·
I maintainer di solito rispondono entro 1 giorno
-
AI Generated CI/CD ⚒️ Flaky-tests 🐦 go 🏃
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
valkey-io/valkey-glide#7772 ·
I maintainer di solito rispondono entro 1 giorno
-
Error Handling Swift
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
Automattic/wordpress-rs#1759 ·
I maintainer di solito rispondono entro 1 giorno