Skip to content

fix : corrected misleading NODE_ENV comment in middleware.ts#794

Merged
Priyanshu-byte-coder merged 2 commits into
Priyanshu-byte-coder:mainfrom
tmdeveloper007:#774
May 23, 2026
Merged

fix : corrected misleading NODE_ENV comment in middleware.ts#794
Priyanshu-byte-coder merged 2 commits into
Priyanshu-byte-coder:mainfrom
tmdeveloper007:#774

Conversation

@tmdeveloper007
Copy link
Copy Markdown
Contributor

Closes #774.

Summary of What Has Been Done:
Replaced the misleading comment in src/middleware.ts that incorrectly described how process.env.NODE_ENV behaves.

Changes Made:
Modified: src/middleware.ts

Old comment claimed: 'evaluates dynamically at build compilation runtime' (contradictory)
New comment explains: In Next.js, process.env.NODE_ENV is a compile-time constant baked into the bundle at build time. The higher limits (5000/1000) only apply when NODE_ENV is 'development' (i.e., during next dev). In production builds, the lower limits (60/10) are always used.

Impact it Made:
Prevents developer confusion about the rate limiter's actual runtime behavior.

@vercel
Copy link
Copy Markdown

vercel Bot commented May 23, 2026

@TESTPERSONAL is attempting to deploy a commit to the PRIYANSHU DOSHI's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions Bot added gssoc26 GSSoC 2026 contribution type:bug GSSoC type bonus: bug fix labels May 23, 2026
@github-actions
Copy link
Copy Markdown

GSSoC Label Checklist 🏷️

@Priyanshu-byte-coder — 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

Test User added 2 commits May 23, 2026 09:30
Closes Priyanshu-byte-coder#774

Replaced the misleading comment in src/middleware.ts that claimed NODE_ENV 'evaluates dynamically at build compilation runtime'. In Next.js, process.env.NODE_ENV is a compile-time constant baked into the bundle - it cannot change at runtime. The new comment accurately explains that the higher rate-limit thresholds only apply during local development (next dev) when NODE_ENV is 'development', and that in production builds the lower limits (60/10) are always used.

Impact: Prevents developer confusion about the actual runtime behavior of the rate limiter.
@github-actions github-actions Bot added the type:testing GSSoC type bonus: tests (+10 pts) label May 23, 2026
@Priyanshu-byte-coder Priyanshu-byte-coder added level:beginner GSSoC: Beginner difficulty (20 pts) gssoc:approved GSSoC: PR approved for scoring labels May 23, 2026
@Priyanshu-byte-coder Priyanshu-byte-coder merged commit a62e1b6 into Priyanshu-byte-coder:main May 23, 2026
9 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 level:beginner GSSoC: Beginner difficulty (20 pts) type:bug GSSoC type bonus: bug fix type:testing GSSoC type bonus: tests (+10 pts)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix : correct misleading NODE_ENV comment in middleware.ts

2 participants