Realtime messages can come out of order (and in fact are processed in parallel)
@ChiragAgg5k đang làm issue này rồi.
Từ ngày 24/2/2026.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
👟 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
- 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
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của appwrite/sdk-for-android
-
Realtime does not get notified or retry socket failures correctlyCó thể làm lại được @ChiragAgg5k đã nhận 267 ngày trước và không có pull request nào đang mở. Đang mở
appwrite/sdk-for-android#101 · 1 người được giao ·
-
Support mTLSCó thể làm lại được @ChiragAgg5k đã nhận 267 ngày trước và không có pull request nào đang mở. Đang mở
appwrite/sdk-for-android#100 · 1 bình luận · 1 người được giao ·
-
Compose MultiplatformĐang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
appwrite/sdk-for-android#99 · 1 bình luận · 1 reaction ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 52/100
appwrite/sdk-for-android#96 ·
-
🐛 Bug Report: Cookie ErrorĐang mởbug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
appwrite/sdk-for-android#80 · 1 bình luận ·
Tất cả issue của appwrite/sdk-for-android
Issue tương tự
-
Unified account interface not translated into Simplified ChineseCó thể đã có người làm @xuenhua đã nhận 2 ngày trước. Đang mởunconfirmed
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
thunderbird/thunderbird-android#11936 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Update toast stylingĐang mởdesign good first issue help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 73/100
scribe-org/Scribe-Android#778 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Needs Triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
ankidroid/Anki-Android#23392 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
AI Generated CI/CD ⚒️ Flaky-tests 🐦 go 🏃
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
valkey-io/valkey-glide#7772 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Error Handling Swift
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Automattic/wordpress-rs#1759 ·
Maintainer thường phản hồi trong vòng 1 ngày