Skip to content

Crash when opening a Talk Room with non-emoji reactions #5956

@0xlua

Description

@0xlua

Steps to reproduce

  1. Create a Chat Room
  2. Send a message
  3. Add a custom reaction in the format ":reaction:" (e.g. ":thank_you:") to that message (not possible via UI)
  4. Open the Chat Room in the Nextcloud Talk App

Expected behaviour

I can see the messages inside this room including reactions.
All other Nextcloud Talk Clients (Linux, Windows, Mac, iOS) work as expected.

Actual behaviour

Client Crashes with "AndroidRuntime: java.lang.NumberFormatException: For input string: "thank_you""

Device brand and model

Google Pixel 7a

Android version

16

Nextcloud Talk app version

23.0.0

Nextcloud server version

32.0.1

Talk version

22.0.2

Custom Signaling server configured

None

Custom TURN server configured

None

Custom STUN server configured

None

Android logs

--------- beginning of crash
03-12 14:26:57.239   585  6553 E AndroidRuntime: FATAL EXCEPTION: DefaultDispatcher-worker-9
03-12 14:26:57.239   585  6553 E AndroidRuntime: Process: com.nextcloud.talk2, PID: 585
03-12 14:26:57.239   585  6553 E AndroidRuntime: java.lang.NumberFormatException: For input string: "thank_you"
03-12 14:26:57.239   585  6553 E AndroidRuntime: 	at java.lang.Integer.parseInt(Integer.java:781)
03-12 14:26:57.239   585  6553 E AndroidRuntime: 	at java.lang.Integer.parseInt(Integer.java:897)
03-12 14:26:57.239   585  6553 E AndroidRuntime: 	at com.nextcloud.talk.data.source.local.converters.LinkedHashMapConverter.stringToLinkedHashMap(LinkedHashMapConverter.kt:35)
03-12 14:26:57.239   585  6553 E AndroidRuntime: 	at com.nextcloud.talk.data.database.dao.ChatMessagesDao_Impl.getChatMessageEntity$lambda$0(ChatMessagesDao_Impl.kt:1813)
03-12 14:26:57.239   585  6553 E AndroidRuntime: 	at com.nextcloud.talk.data.database.dao.ChatMessagesDao_Impl.$r8$lambda$07hGBVKgd5tfEM1wFb7yfWBYYXM(Unknown Source:0)
03-12 14:26:57.239   585  6553 E AndroidRuntime: 	at com.nextcloud.talk.data.database.dao.ChatMessagesDao_Impl$$ExternalSyntheticLambda8.invoke(D8$$SyntheticClass:0)
03-12 14:26:57.239   585  6553 E AndroidRuntime: 	at androidx.room.util.DBUtil__DBUtil_androidKt$performSuspending$lambda$1$$inlined$internalPerform$1.invokeSuspend(DBUtil.kt:173)
03-12 14:26:57.239   585  6553 E AndroidRuntime: 	at androidx.room.util.DBUtil__DBUtil_androidKt$performSuspending$lambda$1$$inlined$internalPerform$1.invoke(Unknown Source:8)
03-12 14:26:57.239   585  6553 E AndroidRuntime: 	at androidx.room.util.DBUtil__DBUtil_androidKt$performSuspending$lambda$1$$inlined$internalPerform$1.invoke(Unknown Source:4)
03-12 14:26:57.239   585  6553 E AndroidRuntime: 	at androidx.room.coroutines.PassthroughConnectionPool$useConnection$2.invokeSuspend(PassthroughConnectionPool.kt:59)
03-12 14:26:57.239   585  6553 E AndroidRuntime: 	at androidx.room.coroutines.PassthroughConnectionPool$useConnection$2.invoke(Unknown Source:8)
03-12 14:26:57.239   585  6553 E AndroidRuntime: 	at androidx.room.coroutines.PassthroughConnectionPool$useConnection$2.invoke(Unknown Source:4)
03-12 14:26:57.239   585  6553 E AndroidRuntime: 	at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndspatched(Undispatched.kt:66)
03-12 14:26:57.239   585  6553 E AndroidRuntime: 	at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:43)
03-12 14:26:57.239   585  6553 E AndroidRuntime: 	at kotlinx.coroutines.BuildersKt__Builders_commonKt.withContext(Builders.common.kt:165)
03-12 14:26:57.239   585  6553 E AndroidRuntime: 	at kotlinx.coroutines.BuildersKt.withContext(Unknown Source:1)
03-12 14:26:57.239   585  6553 E AndroidRuntime: 	at androidx.room.coroutines.PassthroughConnectionPool.useConnection(PassthroughConnectionPool.kt:59)
03-12 14:26:57.239   585  6553 E AndroidRuntime: 	at androidx.room.RoomConnectionManager.useConnection(RoomConnectionManager.android.kt:138)
03-12 14:26:57.239   585  6553 E AndroidRuntime: 	at androidx.room.RoomDatabase.useConnection(RoomDatabase.android.kt:619)
03-12 14:26:57.239   585  6553 E AndroidRuntime: 	at androidx.room.util.DBUtil__DBUtil_androidKt$performSuspending$$inlined$compatCoroutineExecute$DBUtil__DBUtil_androidKt$1.invokeSuspend(DBUtil.android.kt:261)
03-12 14:26:57.239   585  6553 E AndroidRuntime: 	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:34)
03-12 14:26:57.239   585  6553 E AndroidRuntime: 	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:100)
03-12 14:26:57.239   585  6553 E AndroidRuntime: 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1154)
03-12 14:26:57.239   585  6553 E AndroidRuntime: 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:652)
03-12 14:26:57.239   585  6553 E AndroidRuntime: 	at java.lang.Thread.run(Thread.java:1563)
03-12 14:26:57.239   585  6553 E AndroidRuntime: 	Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@2e2dcb7, Dispatchers.IO]

Server log

Additional information

We migrated some Rooms from Mattermost to Nextcloud Talk, including reactions to messages. Since Mattermost does support custom emojis, while Talk doesn't yet, we had to migrate these in the following format: :emojiname:. For example :thank_you: or :1:. This works fine on the web and desktop clients:

Image

On Android this leads to the crash described above.

This seems to be the relevant Code line: https://github.com/nextcloud/talk-android/blob/master/app/src/main/java/com/nextcloud/talk/data/source/local/converters/LinkedHashMapConverter.kt#L33

  • the converter expects the reaction in the this format: "👍:1"
  • the custom emoji/reaction will look like this: ":thank_you::1"
  • splitting these at ":" creates these lists respectively: ["👍", "1"] and ["", "thank_you", "","1"]
  • trying to convert the second string to an integer works for the first ("1") example but crashes for the second ("thank_you").

Metadata

Metadata

Assignees

No one assigned

    Labels

    1. to developAccepted and waiting to be taken care of (should be only set by nextcloud employees)bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions