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

Folders and Devices lists are not updated properly #820

Closed
lukash opened this issue Dec 21, 2016 · 15 comments
Closed

Folders and Devices lists are not updated properly #820

lukash opened this issue Dec 21, 2016 · 15 comments

Comments

@lukash
Copy link

lukash commented Dec 21, 2016

The items in Folders and Devices seem to be stuck in some initial state and almost never update to display the actual status. Even when a sync is going on, it is not shown, the remote device in question is shown as Disconnected and the synced folder as Idle.

App Version: 0.9.2
Syncthing Version: v0.14.14
Android Version: Android 6.0.1
Remote Desktop Syncthing Version: v0.14.15
@licaon-kter
Copy link
Contributor

WebUI-> overide/rescan helps?

@lukash
Copy link
Author

lukash commented Dec 21, 2016

How do I login to the WebUI...

@licaon-kter
Copy link
Contributor

Press the WebUI button above Settings, maybe?

@lukash
Copy link
Author

lukash commented Dec 21, 2016

Ah, good idea! :) (I went through a browser)

Well, the override/rescan is for when directories are out of sync, as far as I understand. What I was trying to describe is that what is shown in the Android GUI does not reflect what is currently going on with Syncthing. First post says it.

Might be the sync put a high load on the phone, it was a lot of data and a lot of files. It saturated my network (well, at ~1.25MB/s it's not very impressive) or at least it seemed so and Syncthing and the whole phone was a bit laggy too. Still, the state of the folder and device never updated.

Now it seems to be OK, after the sync finished and everything settled. But when something is going on, the UI always seems finicky, not reflecting actual state, it says something different that the remote end says etc...

It can't just be me, I don't use it all that often, but every time I was setting up something or trying to make it sync while it didn't, it was like this.

@licaon-kter
Copy link
Contributor

licaon-kter commented Dec 21, 2016

You can force sync via WebUI.

Else, it won't sync the second you add something new (the inotify thing should do that, not sure how it does it in Android 6, search the issues) so the idle state feels out of touch most of the time.

Basically, just leave it alone in the background, eventually things will be in sync.
If you need something right away see primitiveftpd (you'll need a client though) or Total Commander WiFi plugin (open a browser on the destination).

@Nutomic
Copy link
Contributor

Nutomic commented Dec 22, 2016

Folder and device lists only update every 10 seconds (to save battery). Does it display correctly if you wait 10 seconds?

@lukash
Copy link
Author

lukash commented Dec 22, 2016

Well, it didn't in the yesterday's case. Now it more or less works according to what you said - 10 seconds delay. I am at the moment unable to reproduce it again.

But why such a delay? It makes the UI look flimsy. It adds to the delays of syncthing itself (which I suppose are by design, but still undesired) and some random lagginess introduced I suppose by the interaction with the background daemon and the user experience suffers a lot.

While in fact I think the polling interval adds a completely negligible battery drain when the app is open and the screen is on. The user experience should take priority here. In case the app is not in foreground or the screen is off, it should preferably not refresh at all. I would thing Android has solid proven mechanisms for this and all the well-designed apps work that way. At least I hope :)

@Nutomic
Copy link
Contributor

Nutomic commented Dec 23, 2016

Yes, the GUI is updated only while the main screen is open. I was told a while ago that faster updates require too much battery, because Syncthing needs to do a bunch of calculations for each update. However, I've never verified this. I'm just gonna change it to one second and see if anyone complains :)

@lukash
Copy link
Author

lukash commented Dec 23, 2016

Thanks! :)

@Simpleton350
Copy link
Contributor

@Nutomic
Unfortunately, I notice my folder list constantly freezing with the 1-second update interval (Android 4.2.2 and 5.0.2). It appears that this is indeed too demanding.

@Nutomic
Copy link
Contributor

Nutomic commented Dec 28, 2016

Freezing how? Maybe you can upload a video?

Also, what device are you using?

@lukash
Copy link
Author

lukash commented Dec 28, 2016

Not freezing ( I take it it means turning unresponsive) for me, but that is on OnePlus 3T, one of the fastest phones right now...

But I still do have problems. I've done some changes to my music library, which I'm syncing to my phone (~70GB, ~6k files). It's (at least on my WiFi) too slow to be realistic to sync all the data through Syncthing, but let's ignore that. While sync of such folder is in progress, the Syncthing app just doesn't update and the log is inaccessible as described in #818. Same thing as happened to me before.

I managed to open the logs through Syncthing once and I saw something fishy in the Android log. There were way too many calls to the rest api and I think it was this line repeated more than 10 times a second:

12-28 16:49:54.635 V/RestTask(19243): Calling Rest API at https://127.0.0.1:8384/rest/system/connections

I'm not entirely sure though and I had to leave and didn't get to the log later (suggestions how to pull it out?), so here is a fresh one (through the MatLog app, rooted), filtered for the rest api calls. Nothing especially wrong in here but we can see it's making quite a lot of requests per that one second:

https://gist.github.com/lukash/206cf9fc7ee56bdd66b7321042dc8459

The time between requests for the folders is quite high. I'm not sure how the daemon side is implemented, but from what is happening to me now it seems the daemon might be starving the REST API when it's doing heavy syncing (although on desktop I don't observe this).

How is the polling implemented on the Android App side? If it's synchronous it could be the cause of the freezing, but that's probably not the case. But what happens if the requests start taking too long?

Also, the polling doesn't scale too well with the number of folders, it would be better to get all the folders at once and some other requests also seem a bit superfluous - if it's necessary to optimize this, which I'm not convinced about.

@Simpleton350
Copy link
Contributor

Yes, unresponsive is what I meant. Please see my attached video. I apologise for its low resolution and focus issues.

This is on an HTC Desire 310 dual (1 GiB RAM) running Android 4.2.2. Its shared folders contain a total of 1290 files, 984 MiB.

It's slightly better on my LG G Pad 7.0 (1 GiB RAM) running Android 5.0.2, however certainly not as smooth as 0.9.2.

ST.tar.gz

@lukash
Copy link
Author

lukash commented Dec 31, 2016

This should probably be reopened, I'm not sure it's getting attention right now.

One more thing, I've reported this issue: syncthing/syncthing#3851

In the state described in the issue, the UI is rather unresponsive and I tried to share a folder with another device via the switch in the Edit Folder dialog. It seemed fine, but once again the change didn't really make it to the syncthing daemon - when checking in the webUI, the checkbox was off in the device. The switch in the app was on, however, until a restart of the App.

(let me know if you want me to create a separate bug for that)

@Nutomic
Copy link
Contributor

Nutomic commented Jan 2, 2017

Yeah please open a new issue. Unfortunately I didnt have time to look at this yet.

@syncthing syncthing locked and limited conversation to collaborators Nov 9, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants