Skip to content

Decouple builds and image generation from MongoDB startup - #249

Merged
barrulus merged 1 commit into
Azgaar:sveltekitfrom
barrulus:fix/lazy-claims-db
Nov 3, 2026
Merged

barrulus merged 1 commit into
Azgaar:sveltekitfrom
barrulus:fix/lazy-claims-db

Conversation

@barrulus

@barrulus barrulus commented Nov 3, 2026

Copy link
Copy Markdown
Collaborator

Importing the image API currently connects to MongoDB before it can choose a database-independent path, and builds require Mongo credentials. Connect lazily using runtime configuration so a clean checkout builds and numeric/random or explicit-COA images render without MongoDB.

Concurrent claim requests share one connection attempt and reuse the successful client. Failed startup connections are closed and retryable; driver connection/server-selection and operation timeouts bound database work. Named image requests and claim mutations return safe, non-cacheable 503 JSON when configuration or MongoDB is unavailable, preserving ordinary generation only after a successful lookup finds no claim. Existing claim authorization and duplicate-key conflict behavior are preserved.

Document optional configuration and add actual image/mutation route regressions with a fake driver. Extend existing PR/push CI to run these regressions and a credential-free production build.

Validation:

  • Production build passes with no .env, Mongo credentials or database stub.
  • npm run check: 0 errors, existing 92 accessibility warnings.
  • 57 tests pass: database startup 1, claims 13, API 15, render limits 12, Discord 11, generation 3, files 2.
  • Changed-code formatting and git diff --check pass. No production claims or Discord messages were modified.

Targets sveltekit, which serves the Vercel application. After merging, verify the upstream deployment and public domain before explicitly closing #233 and updating #238; this is not the default branch.

Closes #233.

@vercel

vercel Bot commented Nov 3, 2026

Copy link
Copy Markdown

@barrulus is attempting to deploy a commit to the azgaar's projects Team on Vercel.

A member of the Team first needs to authorize it.

@barrulus
barrulus merged commit 8f96d78 into Azgaar:sveltekit Nov 3, 2026
1 of 2 checks passed
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