Skip to content

warn: log when in-memory rate limiter used in production (closes #2412)#2427

Merged
Priyanshu-byte-coder merged 1 commit into
Umbrella-io:mainfrom
Rudrasamadhiya:Rudrasamadhiya-patch-1
Jun 16, 2026
Merged

warn: log when in-memory rate limiter used in production (closes #2412)#2427
Priyanshu-byte-coder merged 1 commit into
Umbrella-io:mainfrom
Rudrasamadhiya:Rudrasamadhiya-patch-1

Conversation

@Rudrasamadhiya

Copy link
Copy Markdown
Contributor

Summary

When UPSTASH_REDIS_REST_URL is not configured in production, the middleware silently falls back to an in-memory rate limiter (memoryBuckets). Because serverless environments create new instances on cold starts, the in-memory counter resets to zero on every cold start, making rate limiting ineffective.

This PR adds a console.warn at module initialization time that fires in production when the Upstash credentials are absent, alerting operators that they are running without persistent rate limiting.

Closes #2412

Type of Change

  • Bug fix / observability improvement

…ella-io#2412)

Add warning for missing Upstash Redis configuration in production.
@github-actions github-actions Bot added type:bug GSSoC type bonus: bug fix type:performance GSSoC type bonus: performance (+15 pts) gssoc26 GSSoC 2026 contribution type:security GSSoC type bonus: security (+20 pts) labels Jun 14, 2026
@github-actions

Copy link
Copy Markdown

GSSoC Label Checklist 🏷️

@Umbrella-io — please apply the appropriate labels before merging:

Difficulty (pick one):

  • level:beginner — 20 pts
  • level:intermediate — 35 pts
  • level:advanced — 55 pts
  • level:critical — 80 pts

Quality (optional):

  • quality:clean — ×1.2 multiplier
  • quality:exceptional — ×1.5 multiplier

Validation (required to score):

  • gssoc:approved — counts for points
  • gssoc:invalid / gssoc:spam / gssoc:ai-slop — does not score

Type labels (type:*) are auto-detected from files and title. Review and adjust if needed.
Points formula: (difficulty × quality_multiplier) + type_bonus

@Priyanshu-byte-coder Priyanshu-byte-coder added the gssoc:approved GSSoC: PR approved for scoring label Jun 16, 2026
@Priyanshu-byte-coder Priyanshu-byte-coder merged commit 8223ad3 into Umbrella-io:main Jun 16, 2026
4 checks passed
@github-actions

Copy link
Copy Markdown

🎉 Merged! Thanks for contributing to DevTrack.

If the project has been useful to you, a ⭐ star on the repo is the easiest way to support it — it helps DevTrack get discovered by more developers.

Keep an eye on open issues for your next contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gssoc:approved GSSoC: PR approved for scoring gssoc26 GSSoC 2026 contribution type:bug GSSoC type bonus: bug fix type:performance GSSoC type bonus: performance (+15 pts) type:security GSSoC type bonus: security (+20 pts)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] In-memory rate limiter in middleware.ts resets on every serverless cold start — rate limits ineffective without Upstash Redis

2 participants