Conversation
|
@hearhour is attempting to deploy a commit to the exon Team on Vercel. A member of the Team first needs to authorize it. |
📝 WalkthroughWalkthroughThe Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@lib/shutdown.ts`:
- Line 5: Restore the fail-closed default by changing the return in
lib/shutdown.ts from false back to true so that missing/undefined
PROJECT_SHUTDOWN_ENABLED results in shutdown enabled; update any code that reads
PROJECT_SHUTDOWN_ENABLED (see references in proxy.ts and app/page.ts) to rely on
this centralized behavior, and ensure next.config.ts remains consistent with the
same default; keep the constant/variable name PROJECT_SHUTDOWN_ENABLED and the
existing function in lib/shutdown.ts (the one returning the boolean) as the
single source of truth for this gating change.
| function parseShutdownFlag(value: string | undefined): boolean { | ||
| if (!value) { | ||
| return true; | ||
| return false; |
There was a problem hiding this comment.
Defaulting shutdown to false introduces fail-open behavior and inconsistent gating.
Line 5 flips missing/undefined env handling to live mode. That enables traffic in paths using PROJECT_SHUTDOWN_ENABLED (proxy.ts, app/page.tsx), while next.config.ts still treats missing as shutdown by default, creating split behavior across modules.
Please either keep fail-closed default (true) or update all shutdown checks together with an explicit migration plan.
Suggested fix (restore fail-closed default)
function parseShutdownFlag(value: string | undefined): boolean {
if (!value) {
- return false;
+ return true;
}
return !DISABLED_VALUES.has(value.trim().toLowerCase());
}📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| return false; | |
| function parseShutdownFlag(value: string | undefined): boolean { | |
| if (!value) { | |
| return true; | |
| } | |
| return !DISABLED_VALUES.has(value.trim().toLowerCase()); | |
| } |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@lib/shutdown.ts` at line 5, Restore the fail-closed default by changing the
return in lib/shutdown.ts from false back to true so that missing/undefined
PROJECT_SHUTDOWN_ENABLED results in shutdown enabled; update any code that reads
PROJECT_SHUTDOWN_ENABLED (see references in proxy.ts and app/page.ts) to rely on
this centralized behavior, and ensure next.config.ts remains consistent with the
same default; keep the constant/variable name PROJECT_SHUTDOWN_ENABLED and the
existing function in lib/shutdown.ts (the one returning the boolean) as the
single source of truth for this gating change.
Summary by CodeRabbit