Skip to content
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

Merged
merged 6 commits into from
Mar 3, 2022

Conversation

Claire1817
Copy link
Contributor

@Claire1817 Claire1817 commented Mar 2, 2022

Type of change

  • Feature
  • Bugfix
  • Technical
  • Other :

Content

Upload image in thread io instead of mainThread

Motivation and context

Closes #5402

Screenshots / GIFs

Tests

  • Step 1
  • Step 2
  • Step ...

Tested devices

  • Physical
  • Emulator
  • OS version(s):

Checklist

@Claire1817 Claire1817 marked this pull request as draft March 2, 2022 15:05
Copy link
Member

@bmarty bmarty left a 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 🤔

@@ -0,0 +1 @@
[Create room] Picture doesn't not displayed
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
[Create room] Picture doesn't not displayed
[Create room] Setting an avatar when creating a room had no effect

)
withContext(coroutineDispatchers.io) {
val response = fileUploader.uploadFromUri(avatarUri, fileName, MimeTypes.Jpeg)
sendStateEvent(
Copy link
Member

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.

Copy link
Contributor Author

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.

Copy link
Contributor Author

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.

Copy link
Member

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!

@github-actions
Copy link

github-actions bot commented Mar 2, 2022

Unit Test Results

  92 files  +  4    92 suites  +4   1m 11s ⏱️ +13s
162 tests +  3  162 ✔️ +  3  0 💤 ±0  0 ±0 
524 runs  +12  524 ✔️ +12  0 💤 ±0  0 ±0 

Results for commit efe413f. ± Comparison against base commit 74040c5.

♻️ This comment has been updated with latest results.

Claire1817 and others added 2 commits March 2, 2022 16:39
…al/session/room/create/CreateRoomBodyBuilder.kt

Co-authored-by: Benoit Marty <[email protected]>
@ouchadam
Copy link
Contributor

ouchadam commented Mar 3, 2022

we had a similar issue when changing user avatar

@Claire1817 Claire1817 marked this pull request as ready for review March 3, 2022 15:57
Copy link
Member

@bmarty bmarty left a 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.

@bmarty bmarty enabled auto-merge (squash) March 3, 2022 16:04
@bmarty bmarty disabled auto-merge March 3, 2022 21:40
@bmarty bmarty merged commit 2a9e582 into develop Mar 3, 2022
@bmarty bmarty deleted the cgizard/ISSUE-5402 branch March 3, 2022 21:40
onurays added a commit that referenced this pull request Mar 8, 2022
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Create room] Picture doesn't not displayed
3 participants