Conversation
Console (appwrite/console)Project ID: Tip Our Discord community has grown to 24K developers, and counting |
WalkthroughThis PR introduces utility functions for normalizing console variables by extracting the first domain from comma-separated domain lists. A new public function Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Important Action Needed: IP Allowlist UpdateIf your organization protects your Git platform with IP whitelisting, please add the new CodeRabbit IP address to your allowlist:
Reviews will stop working after February 8, 2026 if the new IP is not added to your allowlist. 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
🤖 Fix all issues with AI agents
In `@src/lib/helpers/domains.ts`:
- Around line 11-25: normalizeConsoleVariables currently converts an undefined
_APP_DOMAIN_SITES into an empty string, breaking callers that rely on nullish
coalescing; change normalizeConsoleVariables and getFirstDomain so normalization
only happens when a value is present: update getFirstDomain(domainList: string |
undefined) to return string | undefined and return undefined when domainList is
falsy, and in normalizeConsoleVariables only set _APP_DOMAIN_SITES:
getFirstDomain(variables._APP_DOMAIN_SITES) if variables._APP_DOMAIN_SITES !==
undefined (or spread the property conditionally) so undefined inputs remain
undefined and existing ?? fallbacks keep working; reference functions:
normalizeConsoleVariables and getFirstDomain.
🧹 Nitpick comments (1)
src/lib/helpers/domains.ts (1)
7-10: Trim non-essential doc comments per repo style.These blocks describe straightforward behavior; consider removing to keep comments minimal.
As per coding guidelines, "Use minimal comments; only comment TODOs or complex logic".💡 Suggested cleanup
-/** - * Normalizes console variables by extracting the first domain from comma-separated domain lists. - * This handles the backend sending `_APP_DOMAIN_SITES` (and similar fields) as comma-separated values. - */ export function normalizeConsoleVariables( variables: Models.ConsoleVariables ): Models.ConsoleVariables { @@ -/** - * Extracts the first domain from a potentially comma-separated list of domains. - */ function getFirstDomain(domainList: string | undefined): string {Also applies to: 20-22

What does this PR do?
(Provide a description of what this PR does.)
Test Plan
(Write your test plan here. If you changed any code, please provide us with clear instructions on how you verified your changes work.)
Related PRs and Issues
(If this PR is related to any other PR or resolves any issue or related to any issue link all related PR and issues here.)
Have you read the Contributing Guidelines on issues?
(Write your answer here.)
Summary by CodeRabbit