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 Cantook crash on Android #448

Merged
merged 1 commit into from
Sep 18, 2024
Merged

Conversation

aaronleopold
Copy link
Collaborator

This PR contains two (and potentially 3) fixes relating to using the experimental OPDS V2 with Cantook on Android:

  1. The id field in the auth document is now the full service URL, not the relative path. This caused an immediate crash on Android for whatever reason
  2. The route handler which serves the auth document is now excluded from any auth guard. I am personally not a huge fan of this, as I like to minimize the surface of unauthenticated endpoints. However, there seems to be no other way around it
  3. Instances of APIError (and a few other OPDS-specific 401 responses) will attempt to instruct the client to remove any cookies. The former used to exist, however seems to have been accidentally removed as of ♻️ Update axum and refactor middlewares #400

I want to note that none of these issues surfaced in the Cantook iOS app. In fact, wrt the second fix mentioned above, iOS correctly handles the 401 response which contains the auth document whereas the Android app doesn't 🤷

See discord thread for more context

Copy link

codecov bot commented Sep 17, 2024

Codecov Report

Attention: Patch coverage is 66.66667% with 13 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
apps/server/src/routers/opds/v2_0.rs 0.00% 12 Missing ⚠️
apps/server/src/routers/api/v1/media.rs 0.00% 1 Missing ⚠️
Files with missing lines Coverage Δ
apps/server/src/config/session/utils.rs 29.03% <100.00%> (+29.03%) ⬆️
apps/server/src/errors.rs 26.57% <100.00%> (+4.93%) ⬆️
apps/server/src/middleware/auth.rs 94.36% <100.00%> (+0.08%) ⬆️
apps/server/src/routers/api/v1/media.rs 0.00% <0.00%> (ø)
apps/server/src/routers/opds/v2_0.rs 0.00% <0.00%> (ø)

@aaronleopold aaronleopold marked this pull request as ready for review September 18, 2024 00:00
@aaronleopold aaronleopold merged commit d4f07b7 into develop Sep 18, 2024
8 checks passed
@aaronleopold aaronleopold deleted the al/fix-cantook-android branch September 18, 2024 00:00
@aaronleopold aaronleopold mentioned this pull request Oct 11, 2024
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