audio streaming app plyr.fm
38
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix: import UploadFile from starlette for beartype compatibility (#741)

beartype sees fastapi.UploadFile and starlette.UploadFile as different
classes even though FastAPI re-exports starlette's class. When FastAPI
parses the multipart form, it creates starlette.UploadFile instances,
but our type hint said fastapi.UploadFile - causing BeartypeCallHintParamViolation.

Also switched to logfire.exception() for better error visibility.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>

authored by

nate nowack
Claude Opus 4.5
and committed by
GitHub
6b1086ee 8702e0bc

+5 -4
+2 -1
backend/src/backend/api/tracks/metadata_service.py
··· 6 6 from io import BytesIO 7 7 from typing import TYPE_CHECKING, Any 8 8 9 - from fastapi import HTTPException, UploadFile 9 + from fastapi import HTTPException 10 10 from sqlalchemy.ext.asyncio import AsyncSession 11 11 from sqlalchemy.orm import attributes 12 + from starlette.datastructures import UploadFile 12 13 13 14 from backend._internal.atproto.handles import resolve_handle 14 15 from backend._internal.image import ImageFormat
+3 -3
backend/src/backend/api/tracks/mutations.py
··· 305 305 try: 306 306 await _update_atproto_record(track, auth_session, image_url) 307 307 except Exception as exc: 308 - logger.error( 309 - f"failed to update ATProto record for track {track.id}: {exc}", 310 - exc_info=True, 308 + logfire.exception( 309 + "failed to update ATProto record", 310 + track_id=track.id, 311 311 ) 312 312 await db.rollback() 313 313 raise HTTPException(