forked from mtusi2026/mtusi2026lab5
feat(lab5): durable async attachment pipeline through grade 4
- RabbitMQ quorum queue, persistent messages and publisher confirms - S3 staging plus PostgreSQL attachments/jobs outbox transaction - worker variants (thumbnail, crop, optimized WebP), DB lease and lease sweeper - jittered retry, permanent failures, explicit replay and admission cap - deterministic crash hooks, resilience script and evidence for grade 4 - async-aware custom tests, oversized pixel case, docs and changelog
This commit is contained in:
@@ -29,14 +29,15 @@ def upload(args):
|
||||
response = c.call(
|
||||
"POST",
|
||||
f"/api/v1/chats/{chat['id']}/attachments?filename=sample.png",
|
||||
201,
|
||||
202,
|
||||
actor=alice,
|
||||
raw=content,
|
||||
headers={"Content-Type": "image/png"},
|
||||
schema="Attachment",
|
||||
)
|
||||
attachment = response["json"]
|
||||
check(attachment["status"] == "ready", "upload is not ready")
|
||||
accepted_by = response["headers"].get("X-Instance-Id")
|
||||
attachment = c.wait_ready(alice, response["json"], wait_seconds=60)
|
||||
check(attachment["status"] == "ready", "upload did not become ready")
|
||||
check(
|
||||
attachment["sha256"] == hashlib.sha256(content).hexdigest(),
|
||||
"upload checksum mismatch",
|
||||
@@ -45,7 +46,7 @@ def upload(args):
|
||||
"attachment_id": attachment["id"],
|
||||
"sha256": attachment["sha256"],
|
||||
"size_bytes": attachment["size_bytes"],
|
||||
"instance_id": response["headers"].get("X-Instance-Id"),
|
||||
"instance_id": accepted_by,
|
||||
"token": alice["token"],
|
||||
"chat_id": chat["id"],
|
||||
"content_length": len(content),
|
||||
|
||||
Reference in New Issue
Block a user