Repository navigation
fix(kosync): Kavita works (sign-in answer, and its 400 for an unknown book) - #47
Merged
Merged
Conversation
… it doesn't have
Kavita (1.102.4) answers /users/auth with {"username": ...} (its API key in the path signs in), which Test connection rejected as not a sync server (#42). It also answers an unknown document with 400 "file not found", which would have marked every unsynced book "couldn't check" instead of "not found". A non-empty username now counts as signed in; a 400 or 404 for a document is "nothing there". So that a wrong address can't hide behind that, a full sync pass (Sync now, the 10-minute pass) signs in first; the quick sync before a question stays one request per book.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #42.
Kavita (1.102.4) differs from koreader-sync-server in two ways:
/users/authanswers{"username": "admin"}, not{"authorized": "OK"}(Kavita signs in with the API key in the path). Test connection rejected it as "isn't a KOReader sync server". A non-emptyusernamenow counts as signed in; an empty one still doesn't.400 "file not found", not an empty{}. That would have marked every book Kavita doesn't have as "Couldn't check" instead of "Not found on the server". For a document, 400 and 404 now mean "nothing there".So a wrong address can't hide behind (2) and show "not found" for every book, a full sync pass (Sync now, the 10-minute pass) now signs in first, and a 404 there is a clear error. The quick sync before a question stays one request per book.
Tests: Kavita's answers (sign-in, a known book, an unknown book as 400), an empty username, and a wrong address on a full pass is an error. All KOSync, reading-progress and ask tests pass.