-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
feat(sync): add 'network timeout' preference #20001
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
Conversation
|
Important Maintainers: This PR contains Strings changes
|
BrayanDSO
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that a NumberRangePreferenceCompat would be a better fit than SliderPreference
31732dd to
86218d2
Compare
Exposed as `SyncAuth.io_timeout_secs` in the backend https://github.com/ankitects/anki/blob/8f2144534bff6efedb22b7f052fba13ffe28cbc2/proto/anki/sync.proto#L29-L33 **UI** Upstream exposes this as a '60 seconds' textbox with an up/down picker We expose it as a NumberRangePreferenceCompat: * `@string/sync_io_timeout_secs_key` => `syncIoTimeoutSecs` * Default: 60s * Minimum: 30s * Max: 99999s https://github.com/ankitects/anki/blob/8f2144534bff6efedb22b7f052fba13ffe28cbc2/qt/aqt/profiles.py#L734-L735 https://github.com/ankitects/anki/blob/8f2144534bff6efedb22b7f052fba13ffe28cbc2/qt/aqt/forms/preferences.ui#L718-L742 Fixes 20000
86218d2 to
4e96623
Compare
mikehardy
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - can do an alpha shortly
|
I just tested [AnkiDroid-2.24.0alpha2.parallel.A.apk] and the menu option appears fine and the 30s minimum works too (I put 6s and it auto-corrected to 30s). Meanwhile the network routes from Optus Australia to Europe have improved since 1st Jan so my syncing pretty fast now and doesn't timeout (traceroute has improved from 33.5s and 22.5s). Thanks again guys and BTW if you need to test this in future note that a partial sync is unlikely to timeout – it was only when I was doing full syncs owing to field changes in my note types that the problem occurred. |


Purpose / Description
Anki Desktop exposes 'Network timeout', we should do so as well.
https://forums.ankiweb.net/t/cant-sync-since-1-1-2026/68040/
Fixes
Approach
Expose it as a
IncrementerNumberRangePreferenceCompat:@string/sync_io_timeout_secs_key=>syncIoTimeoutSecsHow Has This Been Tested?
Set in SyncAuth after being set in the UI to 30

Truncated to avoid my hKey becoming public 😅
UI
Learning (optional, can help others)
Exposed as
SyncAuth.io_timeout_secsin the backendhttps://github.com/ankitects/anki/blob/8f2144534bff6efedb22b7f052fba13ffe28cbc2/proto/anki/sync.proto#L29-L33
Upstream exposes this as a '60 seconds' textbox with an up/down picker
https://github.com/ankitects/anki/blob/8f2144534bff6efedb22b7f052fba13ffe28cbc2/qt/aqt/profiles.py#L734-L735 https://github.com/ankitects/anki/blob/8f2144534bff6efedb22b7f052fba13ffe28cbc2/qt/aqt/forms/preferences.ui#L718-L742
Checklist