dsnopek / anki-sync-server

A personal Anki sync server (so you can sync against your own server rather than AnkiWeb)
GNU Affero General Public License v3.0
744 stars 95 forks source link

Sync with Anki iOS app #63

Open GarrisonBaird opened 7 years ago

GarrisonBaird commented 7 years ago

It still has some problems in media sync with iOS app, app will crash after "/msync/begin", I'm not familiar with iOS develop and don't have time to play with it. But anyway, it gets to work. :)

GarrisonBaird commented 7 years ago

Few days later, with many changes to my decks, I tried to debug the problem about media sync, it works well...... Maybe the problem isn't at server side, which means anki-sync-server is compatible with Anki iOS app, including media sync, cheers!

tsudoko commented 7 years ago

Shouldn't the 5th list item be removed then?

GarrisonBaird commented 7 years ago

The problem seems still exist :( Log from App (debug.log at Documents, can get it from iTunes)

[148****127]: ( reinit, "20028.3" )
[148****127]: ( updateCutoff, 174, 148****400 )
[148****128]: ( "Connecting..." )
[148****129]: ( reinit, "20028.3" )
[148****129]: ( updateCutoff, 174, 148****400 )
[148****129]: ( "Checking media..." )
[148****129]: ( findChanges )
[148****129]: ( "Downloading changes..." )
[148****129]: ( "last local usn in 0" )
[148****130]: ( "mediaChanges resp count: 20832" )
Then it crashes

From captured packages: (not the same session as the one above)

POST - https%3A%2F%2Fsync.ankiweb.net%2Fsync%2Fmeta
POST - https%3A%2F%2Fsync.ankiweb.net%2Fsync%2Fstart
POST - https%3A%2F%2Fsync.ankiweb.net%2Fsync%2FapplyChanges
POST - https%3A%2F%2Fsync.ankiweb.net%2Fsync%2Fchunk
POST - https%3A%2F%2Fsync.ankiweb.net%2Fsync%2FapplyChunk
POST - https%3A%2F%2Fsync.ankiweb.net%2Fsync%2FsanityCheck2
POST - https%3A%2F%2Fsync.ankiweb.net%2Fsync%2Ffinish
POST - https%3A%2F%2Fsync.ankiweb.net%2Fmsync%2Fbegin
POST - https%3A%2F%2Fsync.ankiweb.net%2Fmsync%2FmediaChanges
Then it crashes (Connection closed by client)

Last request body: (/msync/mediaChanges)
--Anki-sync-boundary
Content-Disposition: form-data; name="sk"

***key***
--Anki-sync-boundary
Content-Disposition: form-data; name="c"

1
--Anki-sync-boundary
Content-Disposition: form-data; name="data"; filename="data"
Content-Type: application/octet-stream

***binary***
--Anki-sync-boundary--

Last response body: (about 1.5MB)
{"data": [["*******.mp3", 24138, "********hash********"], ["*******.mp3", 24138, "********hash********"], .................., ["*******.mp3", 24138, "********hash********"]], "err": ""}