feat: Accept durable queued uploads and publish outbox jobs (U2)
Carry forward the lab4 API and storage baseline, stage verified originals in MinIO, and atomically commit attachment, job, and outbox records before 202. Publish identifier-only jobs with broker confirms and reclaimable outbox leases. Clean abandoned and completed staging objects after database checks.
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Public U2 check while publisher and worker are stopped."""
|
||||
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
sys.path.insert(0, str(ROOT / "tests"))
|
||||
from client import Client, arguments, check, run # noqa: E402
|
||||
|
||||
|
||||
def main():
|
||||
args = arguments("Lab5 durable queued upload")
|
||||
client = Client(args.base_url, args.ca_file)
|
||||
alice, bob, _eve, chat = client.bootstrap()
|
||||
attachment, _content = client.attachment(alice, chat)
|
||||
check(attachment["status"] == "queued", "upload did not enter queued state")
|
||||
client.call("GET", f"/api/v1/attachments/{attachment['id']}/content", 409, actor=bob)
|
||||
message = client.message(alice, chat, "", attachments=[attachment["id"]])["json"]
|
||||
check(message["attachment_ids"] == [attachment["id"]], "queued attachment cannot be linked")
|
||||
print("PASS: 202 queued upload is readable and linkable; content is pending")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
run(main)
|
||||
Reference in New Issue
Block a user