Skip to content
This repository was archived by the owner on Nov 10, 2024. It is now read-only.
This repository was archived by the owner on Nov 10, 2024. It is now read-only.

[BUG] Risk of data loss  #171

Description

@skion

Describe the bug

FastApi-RESTful appears to commit-after-yield in a FastAPI dependency, which most likely creates risk of data loss since when a commit raises an exception a positive HTTP response has already been returned to the user.

To Reproduce
Steps to reproduce the behavior:

  1. Raise an exception after the yield.
  2. Observe the HTTP response is not affected

Expected behavior

When a database transaction cannot be committed, a positive HTTP response should never be sent.

Environment:

  • FastAPI version 0.88.0
  • Python version 3.10.7

Additional context

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions