stream-chat-android icon indicating copy to clipboard operation
stream-chat-android copied to clipboard

User name missing during photo upload

Open jeff-huston opened this issue 3 years ago • 7 comments

Describe the bug During a photo upload, the user data attached to the each of the messages in the channel authored by the current user have empty fields, such as name. After the upload completes, the messages all emit again and this time the attached user data includes the name again. I'm referring to MessageListItem.MessageItem.message.user.name

SDK version

  • 5.7.0 This happens consistently for me on 5.7.0, but doesn't happen on 5.6.0

To Reproduce Steps to reproduce the behavior:

  1. Author some messages in a channel
  2. Create a new message with an attachment that will take some time to upload
  3. Send that message
  4. [Bug] During the upload, all messages in the channel authored by the current user emit new data, and the MessageListItem.MessageItem.message.user.name is empty.
  5. After the upload, all messages in the channel authored by the current user emit new data, and this time the MessageListItem.MessageItem.message.user.name is populated again.

I wasn't able to reproduce this in my first attempts when using the Stream UI Components Sample app. The default stream UI doesn't show any user data for the current user on their own messages (though our app's UX does). But I set a breakpoint in TextAndAttachmentsViewHolder in the Stream UI Components Sample app, and the user's name did seem to be present. Hopefully you're able to find a way to understand and reproduce this issue from from report.

Expected behavior User data associated with all messages continue to include the user's name and other important data.

Device:

  • Vendor and model: Samsung GS21
  • Android version: 12

Screenshots

https://user-images.githubusercontent.com/2012846/183772901-f5325b62-4468-45bf-8e67-f803bcab696a.mov

jeff-huston avatar Aug 09 '22 22:08 jeff-huston

Hey @hustoj2 !

Rafal is working on this issue, as we seem to know where the issue lies, thanks for reporting this! :]

filbabic avatar Aug 10 '22 07:08 filbabic

Hey @hustoj2, I was trying to reproduce this problem but without luck. I enabled avatars for every user in our sample app. You can do that by passing custom ShowAvatarPredicate to MessageListView using setShowAvatarPredicate method. Could you try to reproduce it on your side using our sample? I was also debugging attachments upload flow and the user is always enriched. It would be really helpful if you could provide more details on how to reproduce that or a sample project in which we can see the problem.

adasiewiczr avatar Aug 11 '22 11:08 adasiewiczr

@adasiewiczr Thanks for looking into this. I'll try to create a reduced test case from our code. Hopefully that will point out something I missed on our end or provide a good way to reproduce it.

jeff-huston avatar Aug 11 '22 14:08 jeff-huston

This is still an issue in 5.8.0, but we did update to 5.8.0 since it contained a different fix that was more important than this issue.

I tried hacking our Fragment+UI code into the Stream sample app, and that didn't reproduce the issue. So there must either be something different in our lower-level setup in our app, or something different in our backend stream instance, or a combination of the two.

It seems like potentially a lot of work to set up a complete reduced test case for this, and I can't provide our entire application. Do you have any ideas for how I can debug the stream code at a deeper level within our own app, to see if I can find out how the User might be getting emitted without enrichment?

jeff-huston avatar Aug 17 '22 15:08 jeff-huston

hey @hustoj2, I would start by observing ClientState::user flow and see if there are some weird changes/emissions while sending the message. Also, check if you are not modifying the user object that comes directly from the state.

adasiewiczr avatar Aug 25 '22 09:08 adasiewiczr

hey @hustoj2, did you manage to find the root cause?

adasiewiczr avatar Sep 08 '22 10:09 adasiewiczr

Thanks for following up. Sorry, I am still seeing this on 5.9.0, but I haven't come back to debugging this yet, as there have been other higher-priority items.

jeff-huston avatar Sep 16 '22 21:09 jeff-huston

This issue has been automatically closed because there has been no response to our request from the original author. Please don't hesitate to comment on the bug if you have any more information for us - we will reopen it right away! Thanks for your contribution.

github-actions[bot] avatar Nov 15 '22 00:11 github-actions[bot]