element-android
element-android copied to clipboard
Sliding the record audio message button just a bit up results in the message beign corrupted
Steps to reproduce
Press the record button and slide up (the intent is for it to go to the "locked recording" state) just a bit (vs all the way up) - then it gets stuck in a weird state, where UI seems to indicate that recording is ongoing, but if you press the send button - the corrupted file is sent (it shows the appropriate length but can't be played)
See the reproduction video: https://youtu.be/1er375g21nk
Outcome
What did you expect?
The app goes into "recording audio message mode" and on the pressing the send button the correct audio-message file is sent. (Or if I didn't slide it far enough up - it reverts to a whatever default state is)
What happened instead?
App seems to indicate the message is being recorded, but it's not - the message file is corrupted.
Here is the event generated by the above repro video:
{
"content": {
"body": "Voice message.ogg",
"info": {
"duration": 13214,
"mimetype": "audio/ogg",
"size": 53543
},
"msgtype": "m.audio",
"org.matrix.msc1767.audio": {
"duration": 13214,
"waveform": [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
]
},
"org.matrix.msc3245.voice": {},
"url": "mxc://matrix.org/xQAodDeASGREzCiwSnPKrSER"
},
"origin_server_ts": 1686893157206,
"sender": "@stvad:matrix.org",
"type": "m.room.message",
"unsigned": {
"age": 138
},
"event_id": "$kxUxCnrkyUPz_GBJ8AlPACzG2pGDjNwMza5VzRjriao",
"room_id": "!ZRGGafuajYmkpVlNmI:matrix.org"
}
The resulting audio file: https://matrix.org/_matrix/media/r0/download/matrix.org/xQAodDeASGREzCiwSnPKrSER
Your phone model
Samsung S21 Ultra
Operating system version
13
Application version and app store
1.5.32
Homeserver
matrix.org
Will you send logs?
Yes
Are you willing to provide a PR?
No
Same issue here
I have this issue also, with the same conditions
From testing I found that the issue is caused for if the finger slides off the button, such as off the screen, no ending touch event is created, and so the next time the button is pressed to end the recording it creates a MotionEvent.ACTION_DOWN which breaks the recording, before sending another MotionEvent.ACTION_UP. Perhaps this could be fixed by checking if there is a pre-existing touch in the draggableStateProcessor?
Edit: This would require changing some of the scopes in the draggableStateProcessor or creating another variable to keep track of that.