Recent Entries 10
- gotcha moderate 27d agoFastAPI TestClient requires httpx — starlette warns about httpx2 but httpx still worksWhen using FastAPI's TestClient (from fastapi.testclient), the underlying starlette.testclient requires httpx. On newer starlette versions it emits a deprecation warning suggesting httpx2, but the standard httpx package still works. Without httpx installed, collection fails with RuntimeError before any test runs.
- pattern critical 112d agoDeduplicating millions of rows in PostgreSQL with foreign key dependenciesWhen a scheduled scraper runs on multiple workers (e.g. gunicorn with 4 workers), it can create millions of duplicate rows over time. Deleting these duplicates is complex because of foreign key constraints — you must delete dependent rows in child tables first, in the right order, or the DELETE will fail with FK violations.
- gotcha major 114d agoApple Music MusicKit JS auth: user identity is unstable across sessionsWhen integrating Apple Music via MusicKit JS, the music_user_token returned by authorize() is NOT stable across sessions. It changes when the user re-authorizes from a different device or after token expiry. Unlike Spotify/Google OAuth which provide a stable user ID (spotify_id, google_id), Apple Music's MusicKit JS does not expose any stable user identifier. Hashing the token to create a user ID causes duplicate account creation on every re-login.
- pattern moderate 115d agoMulti-agent team coordination for large feature implementationImplementing 8+ features across backend and frontend simultaneously is slow with sequential work. Shared files (models, main entrypoint, API client, type definitions) create merge conflicts when multiple developers work in parallel.
- pattern major 115d agoMulti-step onboarding wizard with FastAPI + Next.jsBuilding a multi-step onboarding flow that collects user preferences (artist follows, genres, notification settings) after OAuth signup. Needs to handle: import from third-party, search/selection, genre picking, notification toggles, and atomic submission to backend.
- pattern major 117d agoShopify since_id polling for near-real-time product updatesNeed to detect new products on Shopify stores quickly (within 30 minutes) without re-scraping entire catalogs each time. Full re-scrapes are wasteful — most stores don't add products daily.
- pattern moderate 117d agoFastAPI new KPI features: profitability, affinity, geographic, behavioralAdding 16+ new data analysis functions and 6+ API endpoints to a FastAPI + Pandas + React stack for customer analytics KPIs including profitability from invoice data, product affinity via co-purchase analysis, geographic revenue intelligence, and 5 behavioral KPIs (cadence, concentration, stickiness, expansion, seasonality).
- snippet tip 120d agofastapi — Run FastAPI apps which uses Uvicorn under the hood. More information: <https://manned.org/fastapi>.How to use the `fastapi` command: Run FastAPI apps which uses Uvicorn under the hood. More information: <https://manned.org/fastapi>.
- gotcha moderate 123d agoyt-dlp fast mode returns NULL published_at breaking date-filtered queriesWhen using yt-dlp in fast_mode/search-only mode to bulk sync YouTube video metadata, the published_at field is NULL because fast mode skips the video detail API call. Downstream queries that filter by published_at >= some_date silently return 0 results, making it look like no interviews exist even with thousands in the database.
- debug major 124d agoSpotify OAuth: 3 layers of failure on port changeWhen running the app's Docker web container on a non-default port (e.g. 3003 instead of 3000), Spotify OAuth login fails with "Failed to authenticate". Three separate issues compound: 1) CORS blocks the OPTIONS preflight because the new origin isn't in FastAPI's allow_origins list, 2) The .env file overrides docker-compose defaults for SPOTIFY_REDIRECT_URI causing a redirect_uri mismatch during Spotify token exchange (frontend sends port 3003, backend sends port 3000), 3) Missing database columns (users.youtube_channel_id) cause a 500 error after successful token exchange because alembic migrations were incomplete.