fix(phase-03): use UUID.hex in raw SQL to fix SQLite UUID format mismatch
str(uuid_obj) produces dashed 36-char format; SQLite stores UUID as 32-char hex without dashes, so WHERE user_id = :uid never matched. Using .hex fixes confirm_upload (api/documents.py) and delete_document (services/storage.py). Removes stale xfail from test_delete_decrements_quota — now passes on SQLite. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -185,7 +185,7 @@ async def delete_document(
|
||||
"SET used_bytes = CASE WHEN used_bytes > :delta THEN used_bytes - :delta ELSE 0 END "
|
||||
"WHERE user_id = :uid"
|
||||
),
|
||||
{"delta": doc.size_bytes, "uid": str(doc.user_id)},
|
||||
{"delta": doc.size_bytes, "uid": doc.user_id.hex},
|
||||
)
|
||||
|
||||
await session.delete(doc)
|
||||
|
||||
Reference in New Issue
Block a user