Skip to content

fix(api): public profile private state, longer JWT expiry, hermetic tests, and xdist acceleration (#296, #300, #284, #285) - #311

Merged
ALeonard9 merged 3 commits into
mainfrom
api-movie-search-release-date
Aug 6, 2026
Merged

fix(api): public profile private state, longer JWT expiry, hermetic tests, and xdist acceleration (#296, #300, #284, #285)#311
ALeonard9 merged 3 commits into
mainfrom
api-movie-search-release-date

Conversation

@ALeonard9

Copy link
Copy Markdown
Owner

Summary

Resolves #296, #300, #284, and #285 in druthers-api.

  1. Fix 404 error on public profile when all user domains are private (Fix 404 error on public profile when all user domains are private #296):

    • When a user profile exists and visibility_profile admits the viewer but all domain permissions are private, /v1/public/{handle} now returns HTTP 200 with shelves: [] and profile header metadata instead of 404 Not Found.
    • Querying a specific unadmitted shelf (?shelf=category) continues to return 404 Not Found.
  2. Increase JWT access token expiry beyond 15 minutes (Increase JWT access token expiry beyond 15 minutes #300):

    • Set default access_token_expire_minutes to 1440 minutes (24 hours) in app/config.py.
    • Updated create_access_token() in app/auth/oauth2.py and authentication.py to dynamically use settings.access_token_expire_minutes.
  3. Stop integration tests calling live upstream providers (Stop integration tests calling live upstream providers #284):

    • Added an autouse socket guard in tests/conftest.py that fails any test attempting outbound non-loopback HTTP connections, naming the offending host.
    • Added central autouse provider stubs in conftest.py for TMDB, TVMaze, Open Library, IGDB, and watch provider search/enrichment during integration tests.
  4. Speed up test suite: cheap Argon2 in tests, add xdist (Speed up the test suite: cheap Argon2 in tests, add xdist #285):

    • Configured cheap Argon2 parameters (time_cost=1, memory_cost=8, parallelism=1) when ENV=test in app/config.py and app/db/hash.py.
    • Added argon2_config_test.py verifying that production settings (ENV=prod/ENV=local) retain strong Argon2 cost defaults.
    • Added pytest-xdist==3.6.1 to requirements/test.txt and -n auto to pytest.ini.

Test Performance Wall-Clock Benchmark (#285)

  • Before: ~405.0s (single-core, live outbound requests, production Argon2 cost)
  • After: 11.78s (8-core parallel, 100% hermetic, cheap Argon2 in tests)
  • Speedup: ~35x faster (794 passed, 0 failures)

Closes #296. Closes #300. Closes #284. Closes #285.

web#180 (unreleased movies show a release date instead of a rank
affordance) was applied to the watchlist card but not search results,
because search only ever returned a truncated year. Threads TMDB's
release_date through search-hit normalization so the web client can
tell an unreleased title apart there too.
@ALeonard9
ALeonard9 merged commit a5b10a1 into main Aug 6, 2026
9 checks passed
@ALeonard9
ALeonard9 deleted the api-movie-search-release-date branch August 6, 2026 05:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant