Change8

0.118.0

Breaking Changes
📦 fastapiView on GitHub →
1 breaking🐛 2 fixes🔧 3 symbols

Summary

FastAPI 0.118.0 fixes a critical issue where dependencies with 'yield' (like database sessions) were closed before StreamingResponse could finish, and updates security tutorials to use pwdlib.

⚠️ Breaking Changes

  • The execution timing of exit code in dependencies with 'yield' has changed when using StreamingResponse. Exit code now runs after the response is sent rather than before, which may affect resources that expected to be closed prior to transmission.

Migration Steps

  1. If you rely on database sessions or resources within a 'yield' dependency while using StreamingResponse, ensure your logic accounts for the resource closing after the stream completes.
  2. Review 'Advanced Dependencies' documentation if you need to manually close sessions before the response is sent.

🐛 Bug Fixes

  • Fixed support for StreamingResponses with dependencies using 'yield' or UploadFiles, ensuring resources remain open until the response is fully sent.
  • Fixed sponsor display issues where badges would show even if images failed to load.

🔧 Affected Symbols

StreamingResponseUploadFilefastapi.dependencies