Closed progserega closed 3 years ago
I was send logs from app with description: "Logs for issue #2163"
What url's was got my android phone (YD201) today:
root@im:~# cat /var/log/matrix-synapse/homeserver.log* | grep 2020-09-24 | grep '@progserega:rsprim.ru' | grep YD201 | cut -d ' ' -f26 | cut -d '?' -f1 | cut -d '+' -f1 | cut -d '!' -f1 | sort | uniq -c | sort -n
1 /_matrix/client/r0/capabilities
1 /_matrix/client/r0/join/
1 /_matrix/client/r0/sendToDevice/m.room.encrypted/1761307263
1 /_matrix/client/r0/sendToDevice/m.room_key_request/$local.1a7ba32e-2ce3-4b32-89c3-fe13d1c85642
1 /_matrix/client/r0/sendToDevice/m.room_key_request/$local.9d5d7a91-d610-480d-876b-5338d809128f
1 /_matrix/client/r0/user/@progserega:rsprim.ru/openid/request_token
1 /_matrix/client/r0/voip/turnServer
1 /_matrix/media/r0/config
2 /_matrix/client/r0/pushrules/global/room/
7 /_matrix/client/unstable/room_keys/keys
10 /_matrix/client/r0/pushers/set
12 /_matrix/media/r0/upload
13 /_matrix/client/unstable/room_keys/version
16 /_matrix/client/r0/pushers
28 /_matrix/client/r0/devices
55 /_matrix/client/r0/keys/query
64 /_matrix/client/r0/user/@progserega:rsprim.ru/account_data/im.vector.setting.breadcrumbs
343 /_matrix/client/r0/groups/
411 /_matrix/client/r0/rooms/
10751 /_matrix/client/r0/sync
I’d like to get back control of the polling interval. I used to be able to change it in old Riot whilst in Element I couldn’t find such an option.
Yesterday I clear all cache of element (in his menu) - this is stop battery drain.
But today I get incoming voice call. And after that (may be) battery drain come again. I get incoming call on Element-desktop, but element-android still screen on and was showing incoming call splash after call was ended. May be incoming call tell android-element sync every 2-3 seconds?
root@im:~# while /bin/true; do sleep 5; cat /var/log/matrix-synapse/homeserver.log|grep '@progserega:rsprim.ru'| grep 2020-09-26 |grep YD201|grep sync|cut -d ' ' -f1 | sort | uniq -c;done
4381 2020-09-26
4384 2020-09-26
4387 2020-09-26
4390 2020-09-26
4391 2020-09-26
4391 2020-09-26
4394 2020-09-26
4394 2020-09-26
4397 2020-09-26
I open element-android and see "incoming call splash screen". But call was ended ~1hour ago. I clear "all cache" again, start element-android, wait when first sync is complete and start monitoring server logs again, but today this not help - sync started again and again every ~3 seconds:
root@im:~# while /bin/true; do sleep 5; cat /var/log/matrix-synapse/homeserver.log|grep '@progserega:rsprim.ru'| grep 2020-09-26 |grep YD201|grep sync|cut -d ' ' -f1 | sort | uniq -c;done
4438 2020-09-26
4439 2020-09-26
4440 2020-09-26
4440 2020-09-26
4440 2020-09-26
4444 2020-09-26
4446 2020-09-26
4448 2020-09-26
4449 2020-09-26
4450 2020-09-26
4451 2020-09-26
4453 2020-09-26
4455 2020-09-26
4456 2020-09-26
4458 2020-09-26
4458 2020-09-26
4461 2020-09-26
4462 2020-09-26
4465 2020-09-26
4467 2020-09-26
4469 2020-09-26
4471 2020-09-26
4473 2020-09-26
4475 2020-09-26
4478 2020-09-26
4480 2020-09-26
4481 2020-09-26
4483 2020-09-26
4485 2020-09-26
4487 2020-09-26
4488 2020-09-26
4489 2020-09-26
4490 2020-09-26
4491 2020-09-26
4491 2020-09-26
4493 2020-09-26
4495 2020-09-26
4498 2020-09-26
4501 2020-09-26
4501 2020-09-26
4501 2020-09-26
4503 2020-09-26
4504 2020-09-26
4506 2020-09-26
4508 2020-09-26
4509 2020-09-26
Only reboot phone stop this increment count of syncing. So, I think that need this steps for reproduce this bug:
I get incoming call again and situation repeat. I try get adb logcat
but in android's logs no information about "loop sync". I see sync requests in server's logs, but not in android logs at some time. Enable developer mode and "more logs" in element-android - not help.
But I found how stop sync request without reboot phone:
Do you can add some battery/job/requests/traffic statistic in app for monitoring "what doing element today" in developer mode?
For example:
I add monitoring of servers logs to zabbix. It show sync request from only my phone:
Element 1.0.10 not fixed this problem: I was accept incoming voice call on pc at 8:40. And after that - element start many sync (graph show only sync from my phone to my matrix-server):
So, for example overview situation of sync at more time window:
Element not syncing at night because I switch off data connection in phone.
@progserega I can reproduce the issue on v1.0.9; the app stucks on the incoming call screen and continue syncing because app is on the foreground, as you said. But with https://github.com/vector-im/element-android/pull/2058 (v1.0.10) I confirm that app is not showing incoming call screen when call answered/rejected from another device and syncs pauses. Do you still see stucked incoming call screen on v1.0.10?
And with v1.0.10 it is normal that you see regular sync requests during call ringing, but you shouldn't see any sync requests when the call answered from another device and the app is in the background.
Regular syncs:
2020-11-19 16:14:39.760 3451-3523/im.vector.app.debug V/SyncThread: Execute sync request with timeout 30000
2020-11-19 16:15:10.565 3451-3523/im.vector.app.debug V/SyncThread: Execute sync request with timeout 30000
2020-11-19 16:15:41.270 3451-3523/im.vector.app.debug V/SyncThread: Execute sync request with timeout 30000
2020-11-19 16:16:11.861 3451-3523/im.vector.app.debug V/SyncThread: Execute sync request with timeout 30000
2020-11-19 16:16:42.868 3451-3523/im.vector.app.debug V/SyncThread: Execute sync request with timeout 30000
2020-11-19 16:17:13.818 3451-3523/im.vector.app.debug V/SyncThread: Execute sync request with timeout 30000
Now I was switch from f-droid version to gplay and will test again.
F-droid version work more stable in this situation. This bug mostly not reproduce in f-droid version.
After reinstall f-droid to gplay version - I get some minimal syncs in graph yesterday. I try incoming call and all was nice ("incoming call" splash on android was hide after I accept incoming call on PC). But today I get more sync again: And I send logs from element with description: "logs for issue 2163"
@onurays, how did you got the logs of android app like this?
2020-11-19 16:14:39.760 3451-3523/im.vector.app.debug V/SyncThread: Execute sync request with timeout 30000
I can't find the way to view those logs in Element app.
Now I check logs of server by execute: while /bin/true; do sleep 3; cat /var/log/matrix-synapse/homeserver.log|grep '@progserega:rsprim.ru' |grep YD201|grep sync|cut -d ' ' -f1 | sort | uniq -c;done
.
And see, that element do not sync every 1-3-6 seconds. It sync only on each receive push event (new message). So my graph show only my messaging, not many unneeded syncs.
In result:
So, in result I sink bug was in broken app-data after updating 1.0.6->...->1.0.10. And after reinstall app with clear app-data - bug is gone. This is strange bug. Thank you for you help. I think issue can be close.
But only I do not understand - what occur every 2 hour: At 10:30, at 12:30, at 14:30 and at 16:30? Many regularity syncs? Why?
3 day graph: every 2 hour phone call many sync-requests to server. Why? And Element in top from battery use with 17%:
As I understand: on every incoming push event tell element do sync. If we get more events - phone will call many syncs. And battery will drain. As I understand this is need for decrypt messages and show it preview. But as I remember - in old riot we have options, which control this situation with variants:
In last variants - we reduce sync calls and reduce battery usage, but events will be such "you have new X messages in Y rooms". In same situation this variant is excellent - if user want more "battery time".
May be I need open new issue for this option?
And tho question:
If always "yes" - so may be it is problem fro battery drain in situation with rooms, where often occur new messages, but this room is muted? For example - I have some rooms with notification of monitoring systems - some of them (with more events per day) is in muted, but may be this is not prevent "sync" on every muted events?
Still issue is open with no progress 👍
I close this bug as party fixed: after voip call battery drain stops - it nice.
But periodicaly strange many syncs still occure. About this bug I create new issue: #2733
Element use too match battery.
I check on my server push:
And sync:
Screenshots Sorry for non-english screenshots.
Most translations:
23.09.2020:
24.09.2020 (no problems with push):
Smartphone:
Additional context