Files
HAL9000 5818b8e02b
CI / lint (pull_request) Failing after 3s
CI / security (pull_request) Failing after 3s
CI / integration_tests (pull_request) Failing after 2s
CI / unit_tests (pull_request) Failing after 3s
CI / typecheck (pull_request) Failing after 4s
CI / push-validation (pull_request) Failing after 3s
CI / helm (pull_request) Failing after 3s
CI / build (pull_request) Failing after 5s
CI / quality (pull_request) Failing after 5s
CI / coverage (pull_request) Has been skipped
CI / docker (pull_request) Has been skipped
CI / status-check (pull_request) Failing after 4s
fix(data-integrity): remove session.rollback() calls from constructor-injected repositories
Unit of Work (UoW) is the sole owner of the SQLAlchemy Session. Repository classes that receive a Session via constructor injection do not own it — calling rollback() on a shared session rolls back ALL pending work in the transaction, discarding writes from other repos in the same UoW scope.

Removed self.session.rollback() calls from:

  - ProjectRepository.create() (OperationalError/SQLAlchemyDatabaseError handler)

  - ActorRepository.set_default_name() (IntegrityError race-condition handler)

Repositories using the session_factory pattern retain their rollback handlers since

each method creates its own session.

Added BDD regression tests to verify:

  - Repository error handlers never invoke session.rollback()

  - Writes from other UoW repositories are preserved when one operation fails

ISSUES CLOSED: #7489
2026-05-15 01:43:50 +00:00
..