Skip to content

fix(kosync): Kavita works (sign-in answer, and its 400 for an unknown book) - #47

Merged
Jatin-Roopchandani merged 1 commit into
mainfrom
kosync-kavita
Dec 1, 2026
Merged

Jatin-Roopchandani merged 1 commit into
mainfrom
kosync-kavita

Conversation

@Jatin-Roopchandani

Copy link
Copy Markdown
Owner

Fixes #42.

Kavita (1.102.4) differs from koreader-sync-server in two ways:

  1. /users/auth answers {"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-empty username now counts as signed in; an empty one still doesn't.
  2. An unknown document is 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.

… 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.
@Jatin-Roopchandani
Jatin-Roopchandani merged commit 13902ea into main Dec 1, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

KOSync "Test connection" fails against Kavita: /users/auth returns {"username": ...} instead of {"authorized": "OK"}

1 participant