test: the request commit check sees Core DML and row locks

A db.execute(update/delete) fires no flush and stages nothing, so a handler whose
only write was Core DML could forget its commit and stay green. The check now
asks Postgres whether the request opened a writing transaction. It found one
real case: a repeated issue send returned with the session row still locked.
This commit is contained in:
2026-10-20 00:45:20 +02:00
parent d73cdcee97
commit e27656ee7e
3 changed files with 44 additions and 1 deletions
+1
View File
@@ -220,6 +220,7 @@ def send_issue(sid: str, user: User = Depends(current_user), db: Session = Depen
raise refused(409, "issue_sending")
new = session.issue_url is None
if not new and not debugsession.unfinished(session):
db.commit() # nothing to send: the lock ends here, not when the request's session closes
return {"ok": True, "session": _view(db, session)}
key = str(user.id)
if new: