Anki/ftl/core
Damien Elmes cf45cbf429
Rework syncing code, and replace local sync server (#2329)
This PR replaces the existing Python-driven sync server with a new one in Rust.
The new server supports both collection and media syncing, and is compatible
with both the new protocol mentioned below, and older clients. A setting has
been added to the preferences screen to point Anki to a local server, and a
similar setting is likely to come to AnkiMobile soon.

Documentation is available here: <https://docs.ankiweb.net/sync-server.html>

In addition to the new server and refactoring, this PR also makes changes to the
sync protocol. The existing sync protocol places payloads and metadata inside a
multipart POST body, which causes a few headaches:

- Legacy clients build the request in a non-deterministic order, meaning the
entire request needs to be scanned to extract the metadata.
- Reqwest's multipart API directly writes the multipart body, without exposing
the resulting stream to us, making it harder to track the progress of the
transfer. We've been relying on a patched version of reqwest for timeouts,
which is a pain to keep up to date.

To address these issues, the metadata is now sent in a HTTP header, with the
data payload sent directly in the body. Instead of the slower gzip, we now
use zstd. The old timeout handling code has been replaced with a new implementation
that wraps the request and response body streams to track progress, allowing us
to drop the git dependencies for reqwest, hyper-timeout and tokio-io-timeout.

The main other change to the protocol is that one-way syncs no longer need to
downgrade the collection to schema 11 prior to sending.
2023-01-18 12:43:46 +10:00
..
actions.ftl Make SpinBox chevrons more subtle (#2243) 2022-12-08 22:32:35 +10:00
adding.ftl Make missing cloze a warning again 2021-06-15 08:43:00 +02:00
browsing.ftl Experiment with labelled note view switch (#2117) 2022-10-10 18:36:11 +10:00
card-stats.ftl Move update logic into CardInfo.svelte 2021-10-18 09:01:24 +02:00
card-template-rendering.ftl Template err improvements (#1953) 2022-07-09 13:00:03 +10:00
card-templates.ftl More template checks (#2032) 2022-09-05 16:52:25 +10:00
change-notetype.ftl Change Notetype UI Rework (#1499) 2021-11-24 12:09:55 +10:00
custom-study.ftl Rework display of available cards in custom study 2022-05-20 17:52:02 +10:00
database-check.ftl move ftl into top level ftl/ folder; make it source of truth for aqt 2020-11-18 16:20:58 +10:00
deck-config.ftl Redesign deck options screen, swap tooltips for help modals (#2139) 2022-10-25 16:18:50 +10:00
decks.ftl run ftl/remove-unused.sh 2021-11-24 14:44:02 +10:00
editing.ftl Fix some issues with the Tag Editor (#2215) 2022-11-27 10:45:33 +10:00
empty-cards.ftl automatically format/check ftl files 2020-11-22 15:30:59 +10:00
errors.ftl Refactor error handling (#2136) 2022-10-21 18:02:12 +10:00
exporting.ftl Change "unique note identifier" to "unique identifier" 2022-06-11 10:11:29 +10:00
fields.ftl Introduce setting to collapse field by default (#1990) 2022-08-31 23:34:39 +10:00
findreplace.ftl automatically format/check ftl files 2020-11-22 15:30:59 +10:00
help.ftl Minor wording tweaks to help.ftl; remove an unused entry 2022-10-27 08:24:38 +10:00
importing.ftl CSV import/export fixes and features (#1898) 2022-06-09 10:28:01 +10:00
keyboard.ftl Add getPlatformString for making shortcuts to platform string 2021-04-22 13:04:24 +02:00
media-check.ftl More template checks (#2032) 2022-09-05 16:52:25 +10:00
media.ftl remove format separator from recording string 2020-12-16 19:44:47 +10:00
network.ftl automatically format/check ftl files 2020-11-22 15:30:59 +10:00
notetypes.ftl Plaintext import/export (#1850) 2022-06-01 20:26:16 +10:00
preferences.ftl Rework syncing code, and replace local sync server (#2329) 2023-01-18 12:43:46 +10:00
profiles.ftl Backup improvements (#1728) 2022-03-21 19:40:42 +10:00
scheduling.ftl Reset->change in due date prompt 2022-06-01 19:44:51 +10:00
search.ftl search-invalid-flag -> search-invalid-flag-2 2021-06-02 21:49:33 +02:00
statistics.ftl run ftl/remove-unused.sh 2021-11-24 14:44:02 +10:00
studying.ftl Fix bury count (more) (#1712) 2022-03-07 11:03:14 +10:00
sync.ftl tweak sync conflict message 2021-09-08 19:19:23 +10:00
undo.ftl move action names out of undo.ftl into actions.ftl 2021-05-08 17:11:54 +10:00