Conversation
update: redirect to org page when the project is not active.
Console (appwrite/console)Project ID: Tip Trigger functions via HTTP, SDKs, events, webhooks, or scheduled cron jobs |
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. WalkthroughThis PR removes the project archival feature and related alerts: deletes components src/lib/components/archiveProject.svelte, src/lib/components/billing/alerts/projectsLimit.svelte, and src/lib/components/billing/alerts/selectProjectCloud.svelte; removes checkForProjectsLimit from src/lib/stores/billing.ts and its invocation from layout; renames archive-related variables/messages to "delete" in organizationUsageLimits; simplifies organization page loader and UI to fetch/display only active projects and removes archived-project UI and selection flows; updates routing/imports (resolve usage) and adds an early redirect for non-active projects to their organization page. Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
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: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/lib/components/organizationUsageLimits.svelte (1)
17-24:⚠️ Potential issue | 🟡 MinorUnused
organizationprop in Props type.The
organizationproperty is declared in thePropstype (line 21) but not destructured from$props()on line 24. The component uses$organizationfrom the store (line 268) instead of the prop.Either remove the unused prop from the type definition, or destructure and use it if it was intended to override the store value.
🧹 Option 1: Remove unused prop from type
type Props = { storageUsage?: number; projects?: Models.Project[]; members?: Models.Membership[]; - organization: Models.Organization; }; - const { projects = [], members = [], storageUsage = 0 }: Props = $props(); + const { projects = [], members = [], storageUsage = 0 } = $props<Props>();
🧹 Nitpick comments (2)
src/routes/(console)/organization-[organization]/+page.svelte (1)
121-121: Consider consistency in optional chaining usage.This line uses
data?.projects.totalwith optional chaining, while lines 52 and 60 accessdata.projects.totaldirectly. Sincedata.projectsis guaranteed from the page loader, the optional chaining here is defensive but inconsistent with nearby usage.♻️ Optional: Align optional chaining usage
- const activeProjectsTotal = $derived(data?.projects.total); + const activeProjectsTotal = $derived(data.projects.total);src/lib/components/organizationUsageLimits.svelte (1)
122-122: Minor grammar improvement."Projects selected for deleting" reads awkwardly. Consider using "deletion" for better grammar.
📝 Suggested fix
- addNotification({ type: 'success', message: `Projects selected for deleting` }); + addNotification({ type: 'success', message: `Projects selected for deletion` });
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Fix all issues with AI agents
In `@src/lib/components/organizationUsageLimits.svelte`:
- Around line 57-61: The excessUsage.projects calculation is missing subtraction
of the free plan limit; update the derived value for projects inside the
$derived block (excessUsage) to compute Math.max(0, currentUsage.projects -
freePlanLimits.projects) so it mirrors the logic used for members and storage
and only shows projects exceeding the limit.
- Around line 307-313: The Alert.Inline title currently contains raw HTML tags
which will render literally; update the Alert.Inline usage so the title prop
contains plain text only (e.g., remove the <b> tags and any HTML around
toLocaleDate($organization.billingNextInvoiceDate) and messagePrefix) and move
any bold/HTML formatting into the component body/default slot where you can use
Svelte markup to wrap formatProjectsToDelete() and the date in <b> or other
styling; specifically modify the Alert.Inline instance (title prop,
toLocaleDate, $organization.billingNextInvoiceDate, and
formatProjectsToDelete()) so the title is plain text and the formatted content
is rendered inside the Alert.Inline children.
🧹 Nitpick comments (1)
src/lib/components/organizationUsageLimits.svelte (1)
17-24: Unusedorganizationprop in type definition.The
organizationproperty is defined inPropsbut never destructured from$props(). The component uses the$organizationstore instead (lines 271, 309). Consider removing it from the Props type to avoid confusion for consumers of this component.♻️ Proposed fix
type Props = { storageUsage?: number; projects?: Models.Project[]; members?: Models.Membership[]; - organization: Models.Organization; };
| const excessUsage = $derived({ | ||
| projects: Math.max(0, currentUsage.projects), | ||
| members: Math.max(0, currentUsage.members - freePlanLimits.members), | ||
| storage: Math.max(0, storageUsageGB - freePlanLimits.storage) | ||
| }); |
There was a problem hiding this comment.
Bug: excessUsage.projects calculation is inconsistent and incorrect.
The projects property doesn't subtract freePlanLimits.projects, unlike members and storage. This means the "Excess usage" column (line 187) will display the total project count instead of projects exceeding the limit.
For example: with 5 projects and a limit of 2, the UI would show "5 projects" excess instead of "3 projects".
🐛 Proposed fix
const excessUsage = $derived({
- projects: Math.max(0, currentUsage.projects),
+ projects: Math.max(0, currentUsage.projects - freePlanLimits.projects),
members: Math.max(0, currentUsage.members - freePlanLimits.members),
storage: Math.max(0, storageUsageGB - freePlanLimits.storage)
});🤖 Prompt for AI Agents
In `@src/lib/components/organizationUsageLimits.svelte` around lines 57 - 61, The
excessUsage.projects calculation is missing subtraction of the free plan limit;
update the derived value for projects inside the $derived block (excessUsage) to
compute Math.max(0, currentUsage.projects - freePlanLimits.projects) so it
mirrors the logic used for members and storage and only shows projects exceeding
the limit.
| <Alert.Inline | ||
| status="warning" | ||
| title={`${messagePrefix} will be archived on ${toLocaleDate($organization.billingNextInvoiceDate)}`}> | ||
| {formatProjectsToArchive()} will be archived | ||
| status="error" | ||
| title={`${messagePrefix} will be permanently deleted on <b>${toLocaleDate($organization.billingNextInvoiceDate)}</b>`}> | ||
| <b>{formatProjectsToDelete()}</b> and all associated data, including databases, | ||
| storage, functions, and users, will be <b>permanently deleted</b>. | ||
| <b>This action is irreversible</b>. | ||
| </Alert.Inline> |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
# Search for package.json to check pink-svelte version
fd package.json | xargs grep -l "pink-svelte" 2>/dev/null | head -5Repository: appwrite/console
Length of output: 72
🏁 Script executed:
# Look for Alert.Inline usage patterns in the codebase
rg "Alert\.Inline" -A 3 -B 1 --max-count 20Repository: appwrite/console
Length of output: 50373
🏁 Script executed:
# Check if Alert component documentation or types exist locally
fd -e d.ts -e ts | xargs grep -l "Alert" 2>/dev/null | grep -i alert | head -10Repository: appwrite/console
Length of output: 158
🏁 Script executed:
# Look for Alert component in node_modules or source
find . -path ./node_modules -prune -o -name "*.svelte" -print | xargs rg -l "Alert" | grep -i alert | head -20Repository: appwrite/console
Length of output: 846
🏁 Script executed:
# Search for Alert component export or definition
rg "export.*Alert|component Alert" -t svelte -t ts -A 5 | head -100Repository: appwrite/console
Length of output: 90
🏁 Script executed:
# Check package.json for pink-svelte version and location
cat package.json | grep -A 2 -B 2 "pink-svelte"Repository: appwrite/console
Length of output: 402
🏁 Script executed:
# Look for pink-svelte in the repo to understand where it's from
find . -type d -name "*pink*" 2>/dev/null | head -20Repository: appwrite/console
Length of output: 909
🏁 Script executed:
# List the Alert component files in pink-svelte
find ./node_modules/.pnpm/@appwrite.io+pink-svelte@https+++pkg.vc+-+@appwrite+@appwrite.io+pink-svelte@dd7e01c_svelte@5.49.2/node_modules/@appwrite.io/pink-svelte -name "*lert*" -o -name "index*" 2>/dev/null | head -20Repository: appwrite/console
Length of output: 3662
🏁 Script executed:
# Get the structure of pink-svelte
ls -la ./node_modules/.pnpm/@appwrite.io+pink-svelte@https+++pkg.vc+-+@appwrite+@appwrite.io+pink-svelte@dd7e01c_svelte@5.49.2/node_modules/@appwrite.io/pink-svelte/ 2>/dev/null | head -30Repository: appwrite/console
Length of output: 409
🏁 Script executed:
# Look for Alert component in dist or src
find ./node_modules/.pnpm/@appwrite.io+pink-svelte@https+++pkg.vc+-+@appwrite+@appwrite.io+pink-svelte@dd7e01c_svelte@5.49.2/node_modules/@appwrite.io/pink-svelte -type f \( -name "*.svelte" -o -name "*.ts" -o -name "*.d.ts" \) 2>/dev/null | xargs grep -l "Alert" | head -10Repository: appwrite/console
Length of output: 233
🏁 Script executed:
# Check the Alert component type definitions and implementation
cat ./node_modules/.pnpm/@appwrite.io+pink-svelte@https+++pkg.vc+-+@appwrite+@appwrite.io+pink-svelte@dd7e01c_svelte@5.49.2/node_modules/@appwrite.io/pink-svelte/dist/alert/index.d.tsRepository: appwrite/console
Length of output: 243
🏁 Script executed:
# Check the Alert component JS implementation
cat ./node_modules/.pnpm/@appwrite.io+pink-svelte@https+++pkg.vc+-+@appwrite+@appwrite.io+pink-svelte@dd7e01c_svelte@5.49.2/node_modules/@appwrite.io/pink-svelte/dist/alert/index.js | head -100Repository: appwrite/console
Length of output: 178
🏁 Script executed:
# List all files in alert directory
ls -la ./node_modules/.pnpm/@appwrite.io+pink-svelte@https+++pkg.vc+-+@appwrite+@appwrite.io+pink-svelte@dd7e01c_svelte@5.49.2/node_modules/@appwrite.io/pink-svelte/dist/alert/Repository: appwrite/console
Length of output: 559
🏁 Script executed:
# Check the Inline.svelte component implementation
cat ./node_modules/.pnpm/@appwrite.io+pink-svelte@https+++pkg.vc+-+@appwrite+@appwrite.io+pink-svelte@dd7e01c_svelte@5.49.2/node_modules/@appwrite.io/pink-svelte/dist/alert/Inline.svelteRepository: appwrite/console
Length of output: 3826
🏁 Script executed:
# Also check the type definitions
cat ./node_modules/.pnpm/@appwrite.io+pink-svelte@https+++pkg.vc+-+@appwrite+@appwrite.io+pink-svelte@dd7e01c_svelte@5.49.2/node_modules/@appwrite.io/pink-svelte/dist/alert/Inline.svelte.d.tsRepository: appwrite/console
Length of output: 776
Remove HTML tags from Alert.Inline title or move formatted content to the body slot.
The title prop in Alert.Inline renders text as plain content without HTML support. The <b> tags in the title will display as literal text in the UI instead of rendering as bold formatting. Either remove the HTML tags from the title or place the formatted content in the default slot instead.
🤖 Prompt for AI Agents
In `@src/lib/components/organizationUsageLimits.svelte` around lines 307 - 313,
The Alert.Inline title currently contains raw HTML tags which will render
literally; update the Alert.Inline usage so the title prop contains plain text
only (e.g., remove the <b> tags and any HTML around
toLocaleDate($organization.billingNextInvoiceDate) and messagePrefix) and move
any bold/HTML formatting into the component body/default slot where you can use
Svelte markup to wrap formatProjectsToDelete() and the date in <b> or other
styling; specifically modify the Alert.Inline instance (title prop,
toLocaleDate, $organization.billingNextInvoiceDate, and
formatProjectsToDelete()) so the title is plain text and the formatted content
is rendered inside the Alert.Inline children.

What does this PR do?
Removes archiving based on latest cloud changes.
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
Refactor