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

Sync stops after Network switch #4381

Open
the-hotmann opened this issue Apr 11, 2024 · 7 comments · May be fixed by #4476
Open

Sync stops after Network switch #4381

the-hotmann opened this issue Apr 11, 2024 · 7 comments · May be fixed by #4476
Assignees
Labels
Milestone

Comments

@the-hotmann
Copy link

the-hotmann commented Apr 11, 2024

Describe the bug

When the network switches from WiFi to mobile while syncing, the syncing process will stop and needs to be manually started again to continue. This is not appreciated; it should resume automatically.

Steps to reproduce

  1. Start syncing.
  2. Switch networks.
  3. Realize it has stopped.

Expected behavior

If the network I switched to is set/allowed to sync, it should resume automatically.

Actual behavior

It stops and needs to be resumed manually.

$ /usr/bin/ocis version
Version: 5.1.0-prealpha+52b00b116
Compiled: 2024-04-10 00:00:00 +0000 UTC

@micbar
Copy link
Contributor

micbar commented Apr 11, 2024

@TheOneRing @dragotin

can you help to gather the needed info? What could trigger that?

@TheOneRing
Copy link

@the-hotmann which client are you using?

@the-hotmann
Copy link
Author

@micbar @TheOneRing thanks for the swift response!

I use the android client from the PlayStore in the latest version 4.2.1 (a41d1f917)

@TheOneRing TheOneRing transferred this issue from owncloud/ocis Apr 12, 2024
@jesmrec
Copy link
Collaborator

jesmrec commented Apr 12, 2024

Thanks for reporting, will take a look inside. Connection is detected as lost in the middle of network switching and not resumed. In fact, connections are only resumed in case of connection recovery after outage.

@the-hotmann
Copy link
Author

@jesmrec you're welcome!
Can you please leep this thread up-to-date and inform us about your findings and eventual changes?

Thanks in advance!

@jesmrec
Copy link
Collaborator

jesmrec commented Apr 15, 2024

Sure. At this point, we'll need to check how deep the changes would be... but it deserves a look.

@jesmrec jesmrec added this to the 4.3 - Current milestone Apr 19, 2024
@jesmrec jesmrec modified the milestones: 4.3 - Current, 4.4 - Future May 24, 2024
@Aitorbp Aitorbp self-assigned this Aug 27, 2024
@Aitorbp
Copy link
Contributor

Aitorbp commented Sep 4, 2024

We have an operating system restriction that causes the worker to be relaunched when it meets the requirements it has. In our case, it has a restriction to only execute if there is an internet connection. When we switch connections (from Wi-Fi to cellular), the operating system decides if there is a violation of the worker’s rules, as it might interpret this specific situation as a loss of connection rather than a network change. In any case, it is something beyond our control as it depends on the operating system.

As a potential solution, we could include a manual retry in the worker’s catch block that only works when there is an active network and a NetworkErrorException has occurred. This way, when a network change occurs, the upload would be retried.

However, this would not completely solve the problem, as this condition might not be met for the following reason:

  • There is a network change, but the process was not fast enough for the network validation function to detect that a network is available. Therefore, it will detect that there is no connection. This issue is arbitrary because it depends on the speed at which the device connects to the network.

This possible solution would only work for workers: uploads and downloads. All other synchronization operations must be handled separately.

On the other hand, we have a problem with the download worker. When we lose the connection, we receive a NoNetworkConnectionException() error when we should receive a NetworkErrorException(). As a result, in this case, we cannot differentiate a priori whether the cause of the error was a server failure or a loss of connection.

@Aitorbp Aitorbp linked a pull request Sep 23, 2024 that will close this issue
2 tasks
@jesmrec jesmrec modified the milestones: 4.4 - Current, 4.5 - Next Sep 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants