quotient-im / libQuotient

A Qt library to write cross-platform clients for Matrix
https://quotient-im.github.io/libQuotient/
GNU Lesser General Public License v2.1
135 stars 56 forks source link

Sync jobs time out all too often #837

Closed KitsuneRal closed 1 day ago

KitsuneRal commented 3 days ago

Describe the bug It can be seen in logs and client UIs that syncing frequently times out. This is most likely because of the smaller timeout values set in f26e3ed924a4699964572972ae487ad8cd1ac1cb to address unit tests occasionally failing when the first request gets stuck for some reason. Long polling implies that sync requests may stay with the server for quite some time, and the current 30 seconds are definitely not long enough to support that.

Expected behavior It's probably best to revert timeouts to their original values and adjust timeouts in unit tests instead. They might run longer but network requests getting stuck are not a normal situation anyway.

KitsuneRal commented 3 days ago

Fun fact: the default timeout for Connection::syncLoop() is also 30 seconds, but it's the server-side time, so the library might be giving up on waiting just before the empty response arrives, due to the network latency. Merely increasing the default timeout to 40s could remove those failures.