Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 3, 2025

Organizations with custom billing plans were showing as "Free" because tierToPlan() defaulted to tierFree for any tier ID not in the static enum.

Changes

  • tierToPlan() function - Added optional plansMap parameter with fallback to plansInfo store for dynamic tier lookups
  • Account organizations page - Pass $plansInfo to tierToPlan() calls displaying organization plan badges
// Before: always returned tierFree for unknown tiers
export function tierToPlan(tier: Tier) {
    switch (tier) {
        // ... static cases
        default:
            return tierFree;  // Custom plans fell through here
    }
}

// After: lookup from map/store for dynamic tiers
export function tierToPlan(tier: Tier, plansMap?: PlansMap): TierData {
    switch (tier) {
        // ... static cases
        default: {
            const map = plansMap || get(plansInfo);
            if (map) {
                const plan = map.get(tier);
                if (plan) {
                    return { name: plan.name, description: plan.desc };
                }
            }
            return tierFree;
        }
    }
}

Backward compatible - existing calls without the parameter use store fallback.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • o1.ingest.sentry.io
    • Triggering command: node (vitest) (dns block)
    • Triggering command: node build.js (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

The account organizations page (src/routes/(console)/account/organizations/+page.svelte) shows orgs on a custom plan as Free because the custom plan does not exist in the tierToPlan map. Instead of defauting to Free, we should lookup the plan info and use the correct name.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@appwrite
Copy link

appwrite bot commented Nov 3, 2025

Console

Project ID: 688b7bf400350cbd60e9

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

Tip

Appwrite has a Discord community with over 16 000 members.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 3, 2025

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


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

Copilot AI and others added 2 commits November 3, 2025 22:42
Modified tierToPlan function to lookup custom plans from plansInfo map instead of defaulting to Free. Updated account organizations page to pass plansInfo to tierToPlan calls.

Co-authored-by: stnguyen90 <1477010+stnguyen90@users.noreply.github.com>
Removed redundant conditional and simplified the default case to use a single variable for the map lookup.

Co-authored-by: stnguyen90 <1477010+stnguyen90@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix display of custom plan names on organizations page Fix custom plan names displaying as "Free" on account organizations page Nov 3, 2025
Copilot AI requested a review from stnguyen90 November 3, 2025 22:55
Copilot finished work on behalf of stnguyen90 November 3, 2025 22:55
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