-
Notifications
You must be signed in to change notification settings - Fork 741
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Create private room] Picture doesn't not displayed #5405
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks.
I am wondering if the fix should not be moved here.
I am not sure why we have NetworkOnMainThreadException
:/
Also observed on release and not on debug version 🤔
changelog.d/5402.bugfix
Outdated
@@ -0,0 +1 @@ | |||
[Create room] Picture doesn't not displayed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Create room] Picture doesn't not displayed | |
[Create room] Setting an avatar when creating a room had no effect |
...d/src/main/java/org/matrix/android/sdk/internal/session/room/create/CreateRoomBodyBuilder.kt
Outdated
Show resolved
Hide resolved
) | ||
withContext(coroutineDispatchers.io) { | ||
val response = fileUploader.uploadFromUri(avatarUri, fileName, MimeTypes.Jpeg) | ||
sendStateEvent( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this could stay outside of the withContext(coroutineDispatchers.io)
block.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method is used when we update the picture in the room settings.
It's not working for me in release (i have a popup : "Sorry, an error occurred")but with this fix it's working.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If i put the with(coroutineDispatchers.io) in here it's working too.
I think it's a better solution to avoid code duplication and always do this action on the io thread.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, so please do it, it will be cleaner. Thanks!
…al/session/room/create/CreateRoomBodyBuilder.kt Co-authored-by: Benoit Marty <[email protected]>
we had a similar issue when changing user avatar |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the update.
@ouchadam it removes your previous fix, the context change is done in the FileUploader now.
Will be squashed and merged to delete git history noise.
* develop: (392 commits) Missing import of at-Ignore annotation. FTUE - Choose a display picture (#5323) Ignore ThreadMessagingTest as it seems to cause other integration tests to fail. Maybe the file is here? I give up for the weekend Frustration at artifact handling vs what's in docs. Update the top bar in a room (#5213) Tweak upload/download of codecov xml file Address review points from adam Remove unneeded code, retaining a comment for how to exclude certain projects Merge pull request #5405 from vector-im/cgizard/ISSUE-5402 Remove the printing of file name to the log as it's doubling up information. Remove exclusions (for now). Fix typo in name of action giving avatar/display name error dialogs human readable error messages - reuses the ErrorDialog logic which translates exceptions to human readable strings Run codecoverage and pass to sonarqube upload for processing. Better codecov based on ouchadam's suggestion Correct name of environment variable Use environment variable that is tied to project property Merge pull request #4498 from vector-im/yostyle/fix_strandhogg ... # Conflicts: # vector/src/main/java/im/vector/app/features/home/room/detail/timeline/action/MessageActionsViewModel.kt
Type of change
Content
Upload image in thread io instead of mainThread
Motivation and context
Closes #5402
Screenshots / GIFs
Tests
Tested devices
Checklist