-
Notifications
You must be signed in to change notification settings - Fork 186
Check for domainsList only for cloud #2362
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
ConsoleProject ID: Sites (2)
Note You can use Avatars API to generate QR code for any text or URLs. |
WalkthroughThree Svelte pages updated to make isNewDomain conditional on isCloud:
Logic change: isNewDomain is computed as isCloud ? (domain not found in data.domainsList.domains) : true. In non-cloud contexts, isNewDomain defaults to true, but creation/update branches remain gated by isCloud and do not run when false. Verification flow, success handling, and error handling remain unchanged. No exported/public declarations were modified. Pre-merge checks (3 passed)✅ Passed checks (3 passed)
Tip 👮 Agentic pre-merge checks are now available in preview!Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.
Please see the documentation for more information. Example: reviews:
pre_merge_checks:
custom_checks:
- name: "Undocumented Breaking Changes"
mode: "warning"
instructions: |
Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal). Please share your feedback with us on this Discord post. ✨ Finishing touches🧪 Generate unit tests
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/routes/(console)/project-[region]-[project]/sites/site-[site]/domains/add-domain/verify-[domain]/+page.svelte (1)
63-65
: Unreachable success path: unconditional throws always error outBoth branches throw regardless of verification result, so the success notification/redirect never execute.
- verified = ruleData.status === 'verified'; - throw new Error( - 'Domain verification failed. Please check your domain settings or try again later' - ); + verified = ruleData.status === 'verified'; + if (!verified) { + throw new Error( + 'Domain verification failed. Please check your domain settings or try again later' + ); + } @@ - verified = domainData.nameservers.toLowerCase() === 'appwrite'; - throw new Error( - 'Domain verification failed. Please check your domain settings or try again later' - ); + verified = domainData.nameservers.toLowerCase() === 'appwrite'; + if (!verified) { + throw new Error( + 'Domain verification failed. Please check your domain settings or try again later' + ); + }Also applies to: 72-74
🧹 Nitpick comments (3)
src/routes/(console)/project-[region]-[project]/sites/site-[site]/domains/add-domain/verify-[domain]/+page.svelte (1)
53-56
: Cloud-only domainsList check: OK; make comparison case-insensitive and align across pagesDomains are case-insensitive. Prefer
.some()
with lowercase to match other files and avoid duplicates.- const isNewDomain = isCloud - ? data.domainsList.domains.findIndex((rule) => rule.domain === page.params.domain) === - -1 - : true; + const isNewDomain = isCloud + ? !data.domainsList.domains.some( + (rule) => + rule.domain.toLowerCase() === page.params.domain.toLowerCase() + ) + : true;src/routes/(console)/project-[region]-[project]/functions/function-[function]/domains/add-domain/verify-[domain]/+page.svelte (1)
52-55
: Cloud-only domainsList check: consider case-insensitive.some()
for consistencyPrevents case-related mismatches and matches the approach used elsewhere.
- const isNewDomain = isCloud - ? data.domainsList.domains.find((rule) => rule.domain === page.params.domain) === - undefined - : true; + const isNewDomain = isCloud + ? !data.domainsList.domains.some( + (rule) => + rule.domain.toLowerCase() === page.params.domain.toLowerCase() + ) + : true;src/routes/(console)/project-[region]-[project]/settings/domains/add-domain/verify-[domain]/+page.svelte (1)
53-56
: Cloud-only domainsList check: normalize to lowercase and use.some()
Tiny consistency/readability improvement and avoids case collisions.
- const isNewDomain = isCloud - ? data.domainsList.domains.find((rule) => rule.domain === page.params.domain) === - undefined - : true; + const isNewDomain = isCloud + ? !data.domainsList.domains.some( + (rule) => + rule.domain.toLowerCase() === page.params.domain.toLowerCase() + ) + : true;
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
src/routes/(console)/project-[region]-[project]/functions/function-[function]/domains/add-domain/verify-[domain]/+page.svelte
(1 hunks)src/routes/(console)/project-[region]-[project]/settings/domains/add-domain/verify-[domain]/+page.svelte
(1 hunks)src/routes/(console)/project-[region]-[project]/sites/site-[site]/domains/add-domain/verify-[domain]/+page.svelte
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: build
- GitHub Check: e2e
What does this PR do?
Check domainsList for cloud only
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