Skip to content

Conversation

@HarshMN2345
Copy link
Member

@HarshMN2345 HarshMN2345 commented Feb 7, 2026

What does this PR do?

image

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
    • Improved maximum file size input precision and handling in storage bucket settings with better unit conversion
    • Fixed updates to row security, table status, and permissions in database table settings

@appwrite
Copy link

appwrite bot commented Feb 7, 2026

Console (appwrite/console)

Project ID: 688b7bf400350cbd60e9

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

Tip

Storage files get ClamAV malware scanning and encryption by default

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 7, 2026

Walkthrough

This PR modifies two Svelte components to enhance configuration capabilities. The first refactors maxValue computation from a function-based approach to a reactive value and introduces a reactive step value computed based on selected unit, adjusting template bindings accordingly and using Math.round for rounding. The second expands a params object to include three new fields (rowSecurity, enabled, permissions) sourced from table data, enabling these fields to be updated through the existing SDK flow while maintaining consistent UI bindings.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 3
✅ 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 directly addresses the two main changes: adjusting max storage conversion (reflected in the maxValue and step reactive variables, Math.round application) and row security changes (reflected in the rowSecurity field additions and update pathway).
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch bugs-console-file-settings

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: 1

🤖 Fix all issues with AI agents
In `@src/lib/helpers/unit.ts`:
- Line 56: The use of Math.round in createValueUnitPair corrupts base values for
non-divisible conversions; update the unit subscription handler in
createValueUnitPair to return the exact division (unitInBase / newUnit.value)
without Math.round so fractional base quantities are preserved, and move any
UI-specific rounding logic to the storage/UI layer (not in
createByteUnitPair/createTimeUnitPair/shared createValueUnitPair) where you can
apply Math.round only for display or max-value constraints.
🧹 Nitpick comments (1)
src/routes/(console)/project-[region]-[project]/storage/bucket-[bucket]/settings/updateMaxFileSize.svelte (1)

22-22: Reactive derivation looks correct, but add a safety guard for the .find() call.

If selectedUnit ever doesn't match an entry in units (e.g., due to a future refactor), .value on undefined will throw. A defensive fallback keeps the component resilient:

Proposed defensive fallback
-    $: maxValue = (service * 1000 * 1000) / units.find((unit) => unit.name === selectedUnit).value;
+    $: maxValue = (service * 1000 * 1000) / (units.find((unit) => unit.name === selectedUnit)?.value ?? 1);

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

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]/databases/database-[database]/table-[table]/settings/+page.svelte (1)

20-28: ⚠️ Potential issue | 🟡 Minor

Avoid passing unused fields to deleteTable; simplify updateTable calls by extracting only needed fields.

The expanded params object is passed to both deleteTable and updateTable, but they have different needs:

  • deleteTable({ ...params }) includes name, rowSecurity, enabled, and permissions, but only requires databaseId and tableId (as shown in table.svelte line 33-36). These extra fields are unnecessary noise.

  • updateTable({ ...params, ...updates }) spreads all current table state before applying the change. While this ensures complete payloads (likely a PUT-style API requirement, per commit "fix: for row security also changing"), it means every update sends all fields—including potentially stale reactive values—which could mask race conditions if concurrent updates occur.

For deleteTable, pass only the required fields: { tableId: page.params.table, databaseId: page.params.database }. For updateTable, consider extracting only the fields actually needed per operation, or document why full payloads are required.

🧹 Nitpick comments (1)
src/routes/(console)/project-[region]-[project]/databases/database-[database]/table-[table]/settings/+page.svelte (1)

31-35: deleteTable now receives unnecessary fields (rowSecurity, enabled, permissions).

The deleteTable function spreads the full params object, which now includes fields irrelevant to a delete operation. While the SDK likely ignores them, it adds noise and could cause issues if the API ever validates unknown fields.

Consider destructuring only what's needed:

Proposed fix
     async function deleteTable() {
+        const { databaseId, tableId } = params;
         await sdk
             .forProject(page.params.region, page.params.project)
-            .tablesDB.deleteTable({ ...params });
+            .tablesDB.deleteTable({ databaseId, tableId });
     }

@HarshMN2345 HarshMN2345 requested a review from Meldiron February 7, 2026 14:45
@HarshMN2345 HarshMN2345 merged commit 13e2b0d into main Feb 9, 2026
3 of 4 checks passed
@HarshMN2345 HarshMN2345 deleted the bugs-console-file-settings branch February 9, 2026 06:06
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