-
-
Notifications
You must be signed in to change notification settings - Fork 136
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
Syncing/refreshing is extremly slow #2531
Comments
The sync takes round about 300ms on my personal device (~2000 notes). You can find the implementation here, as you can see |
I have ~450 notes and it's running on a reasonably fast server with nextcloud data on a ssd (30ms ping time from my phone). Here is a screen recording (switched to favorites to not leak any notes): I don't really know much about android development. |
Maybe use curl / wget to check the lateny od your server. If it is low, we can rule out this as bottleneck |
Attached a debugger to a build of current master, some observations: Both etag and modified are always "0".
All 450 Notes are downloaded in full on each refresh. |
This was due to a wrong capitalization of the etag and last-modified headers. Fixes nextcloud#2531
@stefan-niedermann I fixed this in my PR, did it truly work for you before? |
This was due to a wrong capitalization of the etag and last-modified headers. Fixes nextcloud#2531 Signed-off-by: Paul Scheduikat <[email protected]>
My response headers are as follows:
|
Header names are not case sensitive. From RFC 2616 - "Hypertext Transfer Protocol -- HTTP/1.1", Section 4.2, "Message Headers":
The updating RFC 7230 does not list any changes from RFC 2616 at this part. |
Thanks for the PR! Hm. Renaming would probably fix this for you and raise the issue for me (yes, sync does work quickly here on my setup) 😆 I don't have time to check the actual comparison in the source code, but I think the solution is to use |
See https://www.rfc-editor.org/rfc/rfc2616#section-4.2 In the nextcloud notes android app relying on cased headers lead to the app always downloading every note ever written if a reverse proxy automatically converted all proxied headers to lowercase (cloudflare for example does this). See nextcloud/notes-android#2531
See https://www.rfc-editor.org/rfc/rfc2616#section-4.2 In the nextcloud notes android app relying on cased headers lead to the app always downloading every note ever written if a reverse proxy automatically converted all proxied headers to lowercase (cloudflare for example does this). See nextcloud/notes-android#2531 Signed-off-by: Paul Scheduikat <[email protected]>
@stefan-niedermann Opened a PR upstream as I think it's cleaner to fix it there. |
This issue respects the following points:
Describe the bug
Refreshing/Syncing the Notes app takes way too long (~10 seconds), even if nothing has changed.
I think this means all remote notes are downloaded on every request, at least thats what I got from quickly glancing over the relevant code.
As per the Nextcloud Notes Api docs:
https://github.com/nextcloud/notes/blob/main/docs/api/v1.md#get-all-notes-get-notes
PruneBefore should be used to only download notes that have been remotely changed since the last update:
(or alternatively the ETAG contained in the response)
This is still an issue even if I'm wrong about the cause, it shouldn't take more than a second (accounting for network latency).
Expected behavior
No response
Notes Android version
3.5
Notes server version
4.11
Nextcloud Android version
3.30.6
Nextcloud version
30.0.4
Device
Samsung Galaxy Z Flip 5
Android Version
14
App Store
Stacktrace
No response
The text was updated successfully, but these errors were encountered: