mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-09-27 20:08:34 +00:00
Terminal items were keyed by (System.currentTimeMillis(), System.nanoTime()). nanoTime() is monotonic but not unique: two items created on different threads in the same instant get identical values, and currentTimeMillis() ties as well, so the whole key collides and LazyColumn throws "Key was already used". Terminal items are created concurrently - sendCmd runs in Dispatchers.IO and processReceivedMsg on the receiver thread - so this happened often enough to make the console unusable. Key by a per-item sequence number instead.