Skip to content

Conversation

@ItzNotABug
Copy link
Member

What does this PR do?

Console project is named as Appwrite. Problematic on different Platform types.

Test Plan

N/A.

Related PRs and Issues

N/A.

Checklist

  • Have you read the Contributing Guidelines on issues?
  • If the PR includes a change to an API's metadata (desc, label, params, etc.), does it also include updated API specs and example docs?

@ItzNotABug ItzNotABug self-assigned this Dec 7, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 7, 2025

📝 Walkthrough

Walkthrough

The pull request modifies project name resolution logic in two API controllers to expand the criteria for identifying the Console project. Previously, only an empty project was treated as Console. Now, a project is also identified as Console if its ID equals 'console'. This change affects email template generation in account-related flows (recovery, verification emails) and team invitation emails, ensuring consistent Console project naming across these communication channels.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

  • Both files contain identical logic changes applied consistently
  • The modification is a straightforward addition of an OR condition to an existing check
  • Limited scope with only 2 files affected
  • Homogeneous changes reduce cognitive load per file

However, reviewers should verify:

  • That the 'console' ID string matches the intended project identifier used elsewhere in the codebase
  • That the email template selection logic correctly handles both the empty project and 'console' ID cases in account.php
  • That the change in teams.php properly affects invitation email generation without unintended side effects

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Fix project names' directly relates to the changeset, which modifies how project names are resolved in email templates for both account and teams controllers.
Description check ✅ Passed The description explains that the Console project is incorrectly named as 'Appwrite' and is problematic across different Platform types, which aligns with the changes that treat the Console project specially in email contexts.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-email-templates

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 549570a and fe5505d.

📒 Files selected for processing (2)
  • app/controllers/api/account.php (2 hunks)
  • app/controllers/api/teams.php (1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: hmacr
Repo: appwrite/appwrite PR: 10501
File: app/config/console.php:54-75
Timestamp: 2025-09-16T06:37:59.054Z
Learning: The Console project in Appwrite does not currently have email OTP flows implemented. Adding OTP session email templates to the Console configuration would cause test failures since the authentication flow is not defined for Console at this point.
📚 Learning: 2025-09-16T06:37:59.054Z
Learnt from: hmacr
Repo: appwrite/appwrite PR: 10501
File: app/config/console.php:54-75
Timestamp: 2025-09-16T06:37:59.054Z
Learning: The Console project in Appwrite does not currently have email OTP flows implemented. Adding OTP session email templates to the Console configuration would cause test failures since the authentication flow is not defined for Console at this point.

Applied to files:

  • app/controllers/api/account.php
🧬 Code graph analysis (1)
app/controllers/api/account.php (1)
src/Appwrite/Vcs/Comment.php (1)
  • isEmpty (53-56)
⏰ 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). (3)
  • GitHub Check: Setup & Build Appwrite Image
  • GitHub Check: Setup & Build Appwrite Image
  • GitHub Check: scan
🔇 Additional comments (2)
app/controllers/api/account.php (1)

3533-3603: Console project name resolution in recovery email looks correct

Using ($project->isEmpty() || $project->getId() === 'console') ? 'Console' : $project->getAttribute('name', '[APP-NAME]') cleanly aligns recovery emails with the Console branding while preserving existing behavior for other projects, and short‑circuiting keeps getId() safe when the document is empty. This change doesn’t alter OTP flows for Console, only the displayed project label.

app/controllers/api/teams.php (1)

694-765: Invitation email project name handling is consistent and safe

The updated $projectName expression mirrors the account controller logic, treating an empty project or projectId === 'console' as the Console context and otherwise falling back to the project’s name or [APP-NAME]. This keeps Console invitations branded correctly without impacting non‑console projects.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link

github-actions bot commented Dec 7, 2025

Security Scan Results for PR

Docker Image Scan Results

Package Version Vulnerability Severity
imagemagick 7.1.2.3-r0 CVE-2025-62171 HIGH
imagemagick-c++ 7.1.2.3-r0 CVE-2025-62171 HIGH
imagemagick-dev 7.1.2.3-r0 CVE-2025-62171 HIGH
imagemagick-heic 7.1.2.3-r0 CVE-2025-62171 HIGH
imagemagick-jpeg 7.1.2.3-r0 CVE-2025-62171 HIGH
imagemagick-jxl 7.1.2.3-r0 CVE-2025-62171 HIGH
imagemagick-libs 7.1.2.3-r0 CVE-2025-62171 HIGH
imagemagick-openexr 7.1.2.3-r0 CVE-2025-62171 HIGH
imagemagick-webp 7.1.2.3-r0 CVE-2025-62171 HIGH
libecpg 17.6-r0 CVE-2025-12818 HIGH
libecpg-dev 17.6-r0 CVE-2025-12818 HIGH
libpng 1.6.47-r0 CVE-2025-64720 HIGH
libpng 1.6.47-r0 CVE-2025-65018 HIGH
libpng-dev 1.6.47-r0 CVE-2025-64720 HIGH
libpng-dev 1.6.47-r0 CVE-2025-65018 HIGH
libpq 17.6-r0 CVE-2025-12818 HIGH
libpq-dev 17.6-r0 CVE-2025-12818 HIGH
libxml2 2.13.8-r0 CVE-2025-49794 CRITICAL
libxml2 2.13.8-r0 CVE-2025-49796 CRITICAL
libxml2 2.13.8-r0 CVE-2025-49795 HIGH
libxml2 2.13.8-r0 CVE-2025-6021 HIGH
postgresql17-dev 17.6-r0 CVE-2025-12818 HIGH
github.com/containerd/containerd/v2 v2.0.2 CVE-2024-25621 HIGH
golang.org/x/crypto v0.31.0 CVE-2025-22869 HIGH
golang.org/x/oauth2 v0.24.0 CVE-2025-22868 HIGH
stdlib 1.22.10 CVE-2025-47907 HIGH
stdlib 1.22.10 CVE-2025-58183 HIGH
stdlib 1.22.10 CVE-2025-58186 HIGH
stdlib 1.22.10 CVE-2025-58187 HIGH
stdlib 1.22.10 CVE-2025-61729 HIGH

Source Code Scan Results

🎉 No vulnerabilities found!

@ItzNotABug ItzNotABug marked this pull request as draft December 7, 2025 09:19
@github-actions
Copy link

github-actions bot commented Dec 7, 2025

✨ Benchmark results

  • Requests per second: 1,123
  • Requests with 200 status code: 202,173
  • P99 latency: 0.170869097

⚡ Benchmark Comparison

Metric This PR Latest version
RPS 1,123 1,178
200 202,173 212,125
P99 0.170869097 0.175167719

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants