Skip to content

fix(ratelimit): run without upstash in development - #565

Merged
YOGESH-08 merged 1 commit into
CodeChefVIT:stagingfrom
Dx-Alz-xD:krish/optional-upstash-in-dev
Nov 15, 2026
Merged

YOGESH-08 merged 1 commit into
CodeChefVIT:stagingfrom
Dx-Alz-xD:krish/optional-upstash-in-dev

Conversation

@Dx-Alz-xD

Copy link
Copy Markdown
Contributor

📌 Purpose

Without the Upstash variables, redis was an empty object cast to Redis, so upload, request, subscribe and report-tag all failed with an unclear 500 in local development


Corresponding issue: closes #558


🖼️ Showcase

  • pnpm dev without Upstash: paper request 500 -> 201
  • pnpm build && pnpm start without Upstash: 503 {"message":"rate limiting is not configured"}

🔧 Changes

  • redis is null when the variables are missing, and the limiters are created only when it exists
  • Middleware and rateLimitCheck skip limiting in development and answer 503 in production

➕ Additional Notes

  • Production with Upstash configured is unchanged

without the upstash variables redis was an empty object, so upload,
request, subscribe and report-tag all failed with a 500. skip rate
limiting in development when upstash is missing, and answer 503 with a
clear message in production
@YOGESH-08
YOGESH-08 self-requested a review November 15, 2026 06:52
@YOGESH-08

Copy link
Copy Markdown
Collaborator

Thank you for fixing this, lgtm

@YOGESH-08
YOGESH-08 merged commit 9d3e973 into CodeChefVIT:staging Nov 15, 2026
1 check 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.

Local dev: upload, request and subscribe return 500 when Upstash isn't configured

2 participants