Skip to content
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

Endless loop in SyncThread if network connection is lost during sync #1947

Open
dontub opened this issue Aug 17, 2020 · 1 comment
Open

Endless loop in SyncThread if network connection is lost during sync #1947

dontub opened this issue Aug 17, 2020 · 1 comment
Assignees
Labels
A-Sync T-Defect Something isn't working: bugs, crashes, hangs and other reported problems

Comments

@dontub
Copy link

dontub commented Aug 17, 2020

Describe the bug
When the network connection is lost during sync there's an endless loop in SyncThread. In this case the sync is retried until a connection is available again. See
https://github.com/vector-im/element-android/blob/1b9b18851d2389e41268a56229b8097e663c10b2/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/sync/job/SyncThread.kt#L129
and following lines.

This leads to an endless loop if the network connection is explicitly dropped or a network connection is not possible for other reasons for a longer time. This unnecessary increases the battery usage #536.

To Reproduce
Steps to reproduce the behavior:

  1. Drop network connection during sync.

Expected behavior
The sync should immediately stop if the connection is dropped explicitly (if this can be checked through the Android API) and stop after a few retries. Maybe it makes sense to combine it with an increasing retry delay.

Smartphone (please complete the following information):

  • Device: Samsung S5
  • OS: Android 9 (Lineage OS 16.0)

Additional context

  • develop branch at 1b9b188 with fdroid flavor
  • Homeserver: matrix.org
@dontub
Copy link
Author

dontub commented Aug 19, 2020

It might not be an issue when happening while Element is in foreground because SyncThread is paused when switching to background. Though it is an issue when happening during background sync. #1915 #1920

@MadLittleMods MadLittleMods added T-Defect Something isn't working: bugs, crashes, hangs and other reported problems A-Sync labels Sep 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Sync T-Defect Something isn't working: bugs, crashes, hangs and other reported problems
Projects
None yet
Development

No branches or pull requests

3 participants