GetStream / stream-chat-android

:speech_balloon: Android Chat SDK ➜ Stream Chat API. UI component libraries for chat apps. Kotlin & Jetpack Compose messaging SDK for Android chat
https://getstream.io/chat/sdk/android/
Other
1.44k stars 269 forks source link

Different Attachment Types within one Message cause invalid rendering (Compose UI) #5222

Open jnischler opened 5 months ago

jnischler commented 5 months ago

Describe the bug Having multible different attachments within one message are displayed invalid. The first matched attachment factory needs to render all attachments also not matched attachments.

SDK version

To Reproduce Steps to reproduce the behavior:

  1. Register at least 2 different attachmentFactories
  2. add 2 different attachments to your message
  3. post the message
  4. See error

Expected behavior Only matched attachments should be rendered by the corresponding attachment factory.

Regards Julian

jnischler commented 5 months ago

https://github.com/GetStream/stream-chat-android/blob/105ba6ed9e31023e732e2ce199706670881fd300/stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/attachments/content/MessageAttachmentsContent.kt#L55

At this position you are only checking for the first possible handler so if there is a file in the attachments the file handler will kick in but the media handler cant handle. This should be changed to a per attachment basis oder you need to group the attachments by type this would make the most sense here.

jnischler commented 3 months ago

bump

jnischler commented 1 month ago

any news on this ? this should be fixed!

kanat commented 3 weeks ago

Hi @jnischler,

Thank you very much for bringing this to our attention and for the detailed explanation. It seems that this might be more in line with a feature request rather than an issue.

We appreciate your valuable input and are always keen to improve the product based on user feedback.