Skip to content

feat: serve demo via /blob (lazy seed to S3)#58

Merged
Androz2091 merged 1 commit into
mainfrom
feat/s3-demo-fast-path
May 1, 2026
Merged

feat: serve demo via /blob (lazy seed to S3)#58
Androz2091 merged 1 commit into
mainfrom
feat/s3-demo-fast-path

Conversation

@Androz2091

@Androz2091 Androz2091 commented May 1, 2026

Copy link
Copy Markdown
Member

Summary

The previous S3 PR (#57) only updated the worker code path. Demo doesn't go through the worker — it's generated lazily inside the API — so /demo/data was still hitting API Gateway's slow binary-response path (~25s for 370KB).

This PR puts demo handling in /blob (the new endpoint) instead of /data (the one we'll deprecate once the frontend migrates). First call to /blob/demo after a fresh deploy lazy-seeds S3 from generate_demo_database(); every call after that is just a presigned-URL lookup.

Changes

  • /blob/demo: no auth, lazy-seeds S3, returns `{url, iv: null, ttl}`
  • /blob/: unchanged (auth + DB row + presigned URL with iv as hex)
  • /data fully untouched — still serves demo/real packages the slow way for legacy clients
  • blob_storage.upload() replaces the misleadingly-named upload_encrypted; worker call site updated

Test plan

  • After deploy: `curl https://api.dumpus.app/process/demo/blob\` returns JSON with a presigned URL and iv=null
  • First call slow (~3s — generates SQLite + uploads to S3 + signs URL); subsequent calls fast (~200ms — just signs)
  • `curl -L $url` from the response downloads a valid SQLite at S3 speeds
  • /data?package=demo still works exactly as before (legacy path)

@Androz2091 Androz2091 force-pushed the feat/s3-demo-fast-path branch from 28a11a6 to e73832a Compare May 1, 2026 02:56
Demo doesn't go through the worker, so the previous S3 PR (#57) didn't
help it — /demo/data was still ~25s.

- Move demo handling into /blob (the new endpoint), not /data (the
  endpoint we're deprecating).
- /blob/demo: no auth, lazy-seeds S3 from generate_demo_database() on
  the first call after deploy, returns a presigned URL with iv=null.
- /blob/<real-package>: unchanged (auth + DB row + presigned URL with iv).
- /data left fully untouched.
- blob_storage.upload() replaces the misleadingly-named
  upload_encrypted; worker call site updated.
@Androz2091 Androz2091 force-pushed the feat/s3-demo-fast-path branch from e73832a to 3c0ae82 Compare May 1, 2026 02:57
@Androz2091 Androz2091 changed the title feat: serve demo from S3 (lazy seed) feat: serve demo via /blob (lazy seed to S3) May 1, 2026
@Androz2091 Androz2091 merged commit 72a4ce4 into main May 1, 2026
1 check passed
@Androz2091 Androz2091 deleted the feat/s3-demo-fast-path branch May 1, 2026 02:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant