Skip to content
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

🐛 Fix path error in koreader router #576

Merged
merged 1 commit into from
Jan 30, 2025

Conversation

aaronleopold
Copy link
Collaborator

This PR fixes the following error:

Wrong number of path arguments for `Path`. Expected 1 but got 2. Note that multiple parameters must be extracted with a tuple `Path<(_, _)>` or a struct `Path<YourParams>`

I just did the same fix I did when this happened for OPDS v1.2 after adding API key support to that router. The issue is that I can't force Axum to "ignore" the parent Path params for handlers of nested routers (e.g., :document). So when I construct a handler that only has one Path (e.g., Path(document): Path<String>) it rejects the request outright with that error.

Ideally, I don't need this work around but I haven't figured out how to achieve that wiht Axum yet

Copy link

codecov bot commented Jan 30, 2025

Codecov Report

Attention: Patch coverage is 14.28571% with 6 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
apps/server/src/routers/koreader/sync.rs 0.00% 6 Missing ⚠️
Files with missing lines Coverage Δ
apps/server/src/errors.rs 26.00% <100.00%> (+0.49%) ⬆️
apps/server/src/routers/koreader/sync.rs 0.00% <0.00%> (ø)

@aaronleopold aaronleopold marked this pull request as ready for review January 30, 2025 19:23
@aaronleopold
Copy link
Collaborator Author

I was able to both push and pull progress from a book which has the koreader_hash set in the database. So I'm comfortable merging this 👍

@aaronleopold aaronleopold merged commit 13ac312 into develop Jan 30, 2025
9 checks passed
@aaronleopold aaronleopold deleted the al/fix-koreader-router-issues branch January 30, 2025 19:24
@aaronleopold aaronleopold mentioned this pull request Feb 2, 2025
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.

1 participant