element-hq / element-hq/element-android
many sync - big battery drain
- Dominant language
- Kotlin
- Stars
- 3.7k
- Forks
- 917
- PR merge metrics
- No merged PRs in 30d
Description
Android Element use many sync calls at every day and it is in top of battery usage.
Element do many sync periodicaly - this is strange. For example - we get 2021-01-26 (graphs show only syncs-requests of my phone to my matrix-server) - every 2 hour we get many syncs. And get every hour at second part of day:

Statistics from server logs about this day:
```
cat /var/log/matrix-synapse/homeserver.log* | grep 2021-01-26 | 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/sendToDevice/m.room_key_request/$local.602bef93-d447-4c45-a028-16e224105c75
2 /_matrix/client/r0/capabilities
2 /_matrix/client/r0/pushers/set
2 /_matrix/client/r0/voip/turnServer
2 /_matrix/media/r0/config
6 /_matrix/client/r0/pushers
6 /_matrix/media/r0/upload
7 /_matrix/client/unstable/room_keys/version
9 /_matrix/client/r0/user/@progserega:rsprim.ru/account_data/im.vector.setting.breadcrumbs
11 /_matrix/client/r0/devices
16 /_matrix/media/r0/preview_url
18 /_matrix/client/unstable/room_keys/keys
32 /_matrix/client/r0/rooms/
80 /_matrix/client/r0/keys/query
423 /_matrix/client/r0/groups/
4013 /_matrix/client/r0/sync
```
I think ~4000 syncs per day - big value. I wont show number events received by me at this day, but I do not know sql query for that. If you help me - I will attach this information in comment.
For example - week syncs:

We see periodicaly strange big number of syncs...
this essue as continue of #2163
Element Android: 1.0.13 gplay
Phone: Yotaphone2
Server: matrix-synapse-py3 1.21.2+stretch1 amd64 on debian 9
Contributor guide
Assessment
This issue has not been assessed yet.