-
Notifications
You must be signed in to change notification settings - Fork 758
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
It is not possiable to changing user avatar #4767
Comments
Same as me. |
I'm unable to reproduce this issue (matrix.org and a private server) using the latest from develop, which version of Element Android is this / have you made any modifications?
|
Changes in Element v1.3.9 (2021-12-01) |
interesting 🤔
or
|
This is try catch code,and execute the code Exception:android.os.NetworkOnMainThreadException
|
what happens if we only execute the file uploading? override suspend fun updateAvatar(userId: String, newAvatarUri: Uri, fileName: String) {
val logger = FormattedJsonHttpLogger()
withContext(coroutineDispatchers.main) {
try{
fileUploader.uploadFromUri(newAvatarUri, fileName, MimeTypes.Jpeg)
//setAvatarUrlTask.execute(SetAvatarUrlTask.Params(userId = userId, newAvatarUrl = response.contentUri))
//userStore.updateAvatar(userId, response.contentUri)
}
catch (e :Exception){
logger.log("updateAvatar------>"+ e.message) // android.os.NetworkOnMainThreadException
}
}
} if we still get the |
The way just only execute this code and exception:
however it is not step into below code:
|
I'm really confused by this issue, the only way I've been able to reproduce the @375573088 does changing the dispatcher to - withContext(coroutineDispatchers.main) {
+ withContext(coroutineDispatchers.io) { |
💯 great to hear! I'll raise a PR with the change thanks for your help with debugging |
No problem,hahaha~ |
Fix included in EA 1.3.13 |
Steps to reproduce
It is not possiable to changing user avatar
![image](https://user-images.githubusercontent.com/37624681/146704218-94e90dc1-edf2-4f2c-a6d4-502c296e7320.png)
![image](https://user-images.githubusercontent.com/37624681/146704251-147ca195-48df-4b90-b6e0-86781c8663fc.png)
![image](https://user-images.githubusercontent.com/37624681/146704298-baec10e2-dd6d-4eca-9472-b9ab742d4b09.png)
![image](https://user-images.githubusercontent.com/37624681/146704499-8acff7f7-0003-42c9-beff-f668890f4a62.png)
cut and uploading photo
Outcome
final Exception:android.os.NetworkOnMainThreadException
![image](https://user-images.githubusercontent.com/37624681/146704435-bfed8aae-8b18-44db-b67e-164793b8c443.png)
![image](https://user-images.githubusercontent.com/37624681/146704499-8acff7f7-0003-42c9-beff-f668890f4a62.png)
Your phone model
18208727060
Operating system version
Android 31
Application version and app store
No response
Homeserver
https://im.ynzzpt.cn/
Will you send logs?
Yes
The text was updated successfully, but these errors were encountered: