Fix all pages classified as unknown: re-extract full text from cached PDFs on disk for accurate keyword matching instead of using truncated 250-char DB previews
Fix 502 Gateway Timeout in Auto Classify. Removed synchronous PDF fallback which blocked HTTP. Added DB error checking to Upload. Truncated texts to 250 chars to prevent MySQL packet size limit errors.
Fix 502 Proxy Timeout by moving PDF image rendering to BackgroundTasks. This makes uploads 10x faster and prevents Cloudflare/Nginx from dropping connections.
Enforcing a flat MAX_UPLOAD_BYTES would have blocked legitimate higher-tier
uploads (Studio allows 200 MB, admin 500 MB). Cap the read at the user's plan
file limit instead, bounded by an absolute safety ceiling (default 512 MB) —
memory stays bounded and no plan is wrongly rejected.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Security:
- /cache is no longer public static files: served via an authenticated route
that verifies a valid session AND project ownership (was an IDOR exposing
confidential drawings). Frontend appends the token to <img> cache URLs.
- verify_session_token now reads role FROM THE DB (not the token), so a
demotion/suspension takes effect immediately instead of persisting 8h.
- Cancel the user's Dodo subscriptions on account deletion (was: keep billing
a deleted account).
- Rate limiter keys on the real client IP (cf-connecting-ip / x-forwarded-for)
instead of the proxy IP, which had made it collective/useless behind Render.
- Upload reads are capped at MAX_UPLOAD_BYTES to prevent memory-exhaustion DoS.
- .dockerignore/.gitignore now exclude the local venv and scratch/debug scripts
(several held hardcoded secrets and were being baked into the image).
Reliability:
- DB errors are logged (were silently printed / swallowed as "no rows").
- New transaction() context manager for a…
Update UI, add feedback system, extract name from email