Skip to content

Conversation

@ItzNotABug
Copy link
Member

@ItzNotABug ItzNotABug commented Nov 22, 2025

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

  • Bug Fixes
    • Organization listings are now consistently filtered to display only platform-specific organizations across the entire application. This update applies to organization management pages, billing payment method verification, and all deployment features including functions, sites, and templates. The change ensures consistent and reliable organization data presentation throughout all console interfaces and workflows.

✏️ Tip: You can customize this high-level summary in your review settings.

@ItzNotABug ItzNotABug self-assigned this Nov 22, 2025
@appwrite
Copy link

appwrite bot commented Nov 22, 2025

Console (appwrite/console)

Project ID: 688b7bf400350cbd60e9

Sites (1)
Site Status Logs Preview QR
 console-stage
688b7cf6003b1842c9dc
Ready Ready View Logs Preview URL QR Code

Tip

Schedule functions to run as often as every minute with cron expressions

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 22, 2025

Walkthrough

This pull request adds a platform filter to organization listing queries across multiple pages and components. The Query.equal('platform', 'appwrite') filter is introduced to restrict organization results to those with platform set to 'appwrite' in calls to listOrganization(). The change is applied consistently across eight files including command center searchers, billing store, and various route handlers. The Query import is added where needed, and existing filtering and mapping logic remains unchanged.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~15 minutes

  • Verify filter consistency: Ensure the Query.equal('platform', 'appwrite') filter is applied correctly and consistently across all eight affected files
  • Import validation: Confirm Query is properly imported from @appwrite.io/console in each file and that type imports (like AppwriteException) remain correct after the changes
  • Context validation: Check that the filter is applied in the appropriate code paths (cloud vs. non-cloud conditional logic) for each route handler

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Add: platform filter' directly and specifically describes the main change across all modified files—adding platform equality filters to organization queries throughout the codebase.
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 org-listing-filters

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.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

🧹 Nitpick comments (3)
src/routes/(public)/template-[template]/+page.ts (1)

3-4: Consider refetching organizations after creating the default appwrite organization

With the new platform filter, organizations now represents only appwrite‑platform orgs; if none exist, you create a default org but still return the pre‑creation organizations value (which will remain empty on this first load). If consumers of this load expect the newly created org to be immediately available (similar to the functions/sites deploy flows), it may be safer to refetch after creation using the same filtered query.

Also applies to: 40-47, 49-56

src/lib/stores/billing.ts (1)

557-562: Good tightening of missing‑payment query; consider aligning related upgrade check

Narrowing the query to orgs with no primary and no backup payment method and scoping to platform='appwrite' makes this alert more precise. Given this, you may want to review checkForNewDevUpgradePro’s listOrganization([Query.notEqual('billingPlan', BillingPlan.FREE)]) call to decide whether it should also be restricted to appwrite‑platform orgs for consistency, or if its broader scope is intentional.

src/routes/(console)/account/organizations/+page.ts (1)

13-22: Unified query object looks good; confirm platform filter behavior on self‑host

Centralizing pagination into a shared queries array and reusing it for both teams and billing calls is clean, and the platform='appwrite' filter matches the rest of the PR’s intent. Please just confirm how this filter behaves in non‑cloud/self‑hosted environments (e.g., if platform is missing or unset on teams) to ensure it doesn’t unexpectedly return an empty list there.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5b141ec and bd669c3.

📒 Files selected for processing (8)
  • src/lib/commandCenter/searchers/organizations.ts (1 hunks)
  • src/lib/stores/billing.ts (1 hunks)
  • src/routes/(console)/account/organizations/+page.ts (1 hunks)
  • src/routes/(console)/organization-[organization]/domains/domain-[domain]/settings/+page.ts (1 hunks)
  • src/routes/(public)/functions/deploy/+page.ts (3 hunks)
  • src/routes/(public)/sites/deploy/+page.ts (3 hunks)
  • src/routes/(public)/template-[template]/+page.ts (2 hunks)
  • src/routes/+layout.ts (2 hunks)
🧰 Additional context used
🧬 Code graph analysis (7)
src/routes/(public)/functions/deploy/+page.ts (1)
src/lib/stores/sdk.ts (1)
  • sdk (171-194)
src/routes/(public)/template-[template]/+page.ts (1)
src/lib/stores/sdk.ts (1)
  • sdk (171-194)
src/routes/(console)/account/organizations/+page.ts (1)
src/lib/components/filters/store.ts (1)
  • queries (84-84)
src/lib/commandCenter/searchers/organizations.ts (2)
src/lib/system.ts (1)
  • isCloud (26-26)
src/lib/stores/sdk.ts (1)
  • sdk (171-194)
src/routes/+layout.ts (1)
src/lib/stores/sdk.ts (1)
  • sdk (171-194)
src/routes/(public)/sites/deploy/+page.ts (1)
src/lib/stores/sdk.ts (1)
  • sdk (171-194)
src/routes/(console)/organization-[organization]/domains/domain-[domain]/settings/+page.ts (6)
src/routes/(console)/account/organizations/+page.ts (1)
  • load (8-29)
src/routes/(public)/functions/deploy/+page.ts (1)
  • load (12-111)
src/routes/(public)/sites/deploy/+page.ts (1)
  • load (12-128)
src/routes/(public)/template-[template]/+page.ts (1)
  • load (10-64)
src/routes/+layout.ts (1)
  • load (17-71)
src/lib/system.ts (1)
  • isCloud (26-26)
⏰ 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: e2e
  • GitHub Check: build
🔇 Additional comments (5)
src/routes/(console)/organization-[organization]/domains/domain-[domain]/settings/+page.ts (1)

4-11: Cloud organization fetch correctly scoped to platform

Using a platform filter for the cloud organization list here is consistent with the rest of the PR and keeps the non‑cloud code path unchanged; the change looks good.

src/lib/commandCenter/searchers/organizations.ts (1)

6-11: Command center org searcher matches new platform‑scoped behavior

The searcher now scopes cloud organizations to platform='appwrite' while keeping the non‑cloud path untouched, and the downstream filtering/mapping logic remains valid; this looks good.

src/routes/(public)/sites/deploy/+page.ts (1)

6-7: Platform‑scoped org list and refetch behavior for site deploy

The cloud path now treats “no organizations” as “no appwrite‑platform organizations” and will create a default appwrite org in that case, then refetch using the same filter, which keeps the returned list consistent. Please double‑check that treating existing non‑appwrite orgs as effectively absent for this flow is the desired product behavior.

Also applies to: 83-92, 109-117

src/routes/+layout.ts (1)

11-12: Layout‑wide cloud organizations are now platform‑scoped

Filtering layout‑level cloud organizations to platform='appwrite' aligns with the rest of this PR, but it also changes the data shape seen by all routes relying on data.organizations from this layout. It’s worth quickly checking key consumers to ensure none assume visibility into non‑appwrite organizations in cloud mode.

Also applies to: 41-48

src/routes/(public)/functions/deploy/+page.ts (1)

6-7: Consistent platform‑scoped org handling for function deploy

The cloud function deploy flow now mirrors the sites deploy behavior: it filters organizations to platform='appwrite', and when none are found it creates a default appwrite org and refetches with the same filter. This is internally consistent; just confirm that creating a new appwrite org when only non‑appwrite orgs exist is the intended user experience for this flow.

Also applies to: 66-74, 92-99

@ItzNotABug ItzNotABug merged commit ceef3d7 into main Nov 22, 2025
3 of 4 checks passed
@ItzNotABug ItzNotABug deleted the org-listing-filters branch November 22, 2025 13:26
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.

3 participants