Skip to content

Conversation

@ChiragAgg5k
Copy link
Member

@ChiragAgg5k ChiragAgg5k commented Jan 13, 2026

This PR contains updates to the Command Line SDK for version 13.0.0-rc.5.

Summary by CodeRabbit

Release Notes

  • Bug Fixes

    • Fixed Push all functionality not working correctly
  • New Features

    • Added prompts to confirm code deployment for functions and sites during push operations
    • Enhanced support for handling large integer values in configurations
  • Chores

    • Bumped version to 13.0.0-rc.5 across CLI and installation scripts

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

@coderabbitai
Copy link

coderabbitai bot commented Jan 13, 2026

Walkthrough

This PR releases version 13.0.0-rc.5 of the Appwrite CLI with a fix for the "Push all" functionality not working correctly. The changes include updating version references across documentation, installation scripts, and package manifests from rc.4 to rc.5. The primary functional changes are: introducing code deployment prompts and validation for functions and sites in the push command, expanding type definitions to accept bigint in addition to number for numeric configuration fields, switching JSONBigInt handling from string-based to native BigInt representation, adding error handling for batch attribute updates, and explicit type coercion in calculation operations.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main change: a version bump of the Command Line SDK from 13.0.0-rc.4 to 13.0.0-rc.5 across multiple files and components.

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

✨ Finishing touches
  • 📝 Generate docstrings

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.

code: allowFunctionsCodePush === true,
withVariables: false,
},
siteOptions: { code: allowSitesCodePush === true, withVariables: false },
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

default behaviour to not ask for with variables as before, maybe in future we can ask this too

Copy link

@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 @lib/commands/utils/attributes.ts:
- Around line 594-608: The current try/catch around Promise.all for
changedAttributes swallows errors from this.updateAttribute (called on
collection["databaseId"], collection["$id"]) by only logging them; change it to
propagate the failure so callers know updates failed—either re-throw the caught
error after calling error(...) or convert the block to return a failure result
(e.g., throw new Error or return a rejected Promise) so subsequent deletion
logic does not run on partial failure; ensure the handler for the Promise.all
over changedAttributes preserves the original error details when propagating.
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b6c69c3 and e498003.

📒 Files selected for processing (15)
  • CHANGELOG.md
  • README.md
  • install.ps1
  • install.sh
  • lib/client.ts
  • lib/commands/config.ts
  • lib/commands/push.ts
  • lib/commands/schema.ts
  • lib/commands/utils/attributes.ts
  • lib/commands/utils/pools.ts
  • lib/config.ts
  • lib/constants.ts
  • lib/questions.ts
  • package.json
  • scoop/appwrite.config.json
🧰 Additional context used
🧬 Code graph analysis (2)
lib/commands/push.ts (1)
lib/questions.ts (2)
  • questionsPushFunctionsCode (371-377)
  • questionsPushSitesCode (414-420)
lib/commands/utils/attributes.ts (1)
lib/commands/push.ts (1)
  • error (170-174)
🔇 Additional comments (24)
install.ps1 (1)

16-17: LGTM!

The download URLs are correctly updated to version 13.0.0-rc.5 for both x64 and arm64 architectures, consistent with the version bump across the repository.

package.json (1)

6-6: LGTM!

Version correctly updated to 13.0.0-rc.5, consistent with the release across all package manifests.

CHANGELOG.md (1)

3-5: LGTM!

Changelog entry appropriately documents the release with a concise description of the fix.

README.md (2)

32-32: LGTM!

Version reference correctly updated to 13.0.0-rc.5 in the installation verification example.


63-63: LGTM!

Version reference correctly updated to 13.0.0-rc.5 in the binary installation verification example.

lib/constants.ts (1)

4-4: LGTM!

SDK_VERSION constant correctly updated to 13.0.0-rc.5, ensuring consistent version reporting at runtime.

install.sh (1)

99-99: LGTM!

Version bump to 13.0.0-rc.5 aligns with the release changes across other files in this PR.

scoop/appwrite.config.json (1)

3-3: LGTM!

Scoop manifest version and download URLs are consistently updated to 13.0.0-rc.5 for both x64 and arm64 architectures.

Also applies to: 9-9, 18-18

lib/commands/utils/pools.ts (1)

47-47: LGTM!

The Number(total) coercion correctly handles potential BigInt values returned from the API when using native BigInt JSON parsing. This prevents TypeError from mixing BigInt with regular number division. Given that attribute/index counts are unlikely to exceed safe integer limits, this is an appropriate fix.

Also applies to: 86-86

lib/commands/utils/attributes.ts (1)

4-4: LGTM!

Import addition for error logging utility is appropriate.

lib/config.ts (1)

27-27: LGTM!

Switching to useNativeBigInt: true enables native JavaScript BigInt support for proper arithmetic operations. The configuration is consistent across lib/config.ts, lib/client.ts, and lib/commands/schema.ts, and aligns with the Number() coercion added in lib/commands/utils/pools.ts for handling values that may now be BigInt type.

lib/client.ts (1)

22-22: LGTM! Native BigInt support enabled.

The switch from storeAsString: false to useNativeBigInt: true enables native JavaScript BigInt representation during JSON parsing/stringifying. This aligns with the schema changes in lib/commands/config.ts that now accept bigint types for numeric fields.

lib/commands/schema.ts (1)

12-12: LGTM! Consistent BigInt handling in Schema operations.

This change aligns with the lib/client.ts update, ensuring config files are read and written with native BigInt support. This maintains consistency across the codebase for handling large integers.

lib/questions.ts (2)

371-377: LGTM! New deployment prompt for functions.

The new confirmation prompt follows the existing pattern used by questionsPullFunctionsCode. This enables users to decide whether to create deployments when pushing functions.


414-420: LGTM! New deployment prompt for sites.

Consistent with the functions prompt above and the existing pull patterns.

lib/commands/push.ts (6)

813-832: Good validation: Early path checks with clear error messages.

The validation properly handles:

  1. Missing path configuration
  2. Non-existent paths
  3. Empty directories

The error messages include relative paths for better user experience.


1172-1191: Consistent path validation for sites.

Mirrors the function path validation pattern, ensuring consistent behavior and error messaging across both resource types.


1641-1682: Well-structured code push flow with user prompts.

The implementation:

  • Respects --force flag to bypass prompts
  • Only prompts when there are resources to push
  • Properly distinguishes between "not prompted" (null) and "user declined" (false)

1845-1858: Correct code push decision logic.

The logic properly combines the --no-code CLI flag with the user prompt response:

  • code !== false ensures the flag wasn't explicitly disabled
  • allowCodePush === true ensures user confirmed (or force mode)

1973-1986: Consistent with site push logic.

The function push follows the same pattern as site push, maintaining consistency in the CLI experience.


420-436: Number() coercion handles BigInt from config parsing.

The config system uses JSONBigInt with native BigInt support, which can result in settings.auth.security values being BigInt after parsing. The Number() conversions ensure these values are converted to standard numbers for API compatibility. All documented constraints (duration up to 31536000 seconds, sessionsLimit 1-100) are well within JavaScript's safe integer range, so no precision loss occurs.

lib/commands/config.ts (3)

130-133: Type expansion for BigInt compatibility.

The schema now accepts both number and bigint for these security settings, accommodating native BigInt values from the JSON parser. This aligns with the JSONBigInt configuration changes in lib/client.ts and lib/commands/schema.ts.


158-158: Site timeout supports BigInt.

Consistent with the security settings changes above.


185-185: Function timeout supports BigInt.

Consistent with site timeout and security settings changes.

Comment on lines +594 to +608
try {
await Promise.all(
changedAttributes.map((changed) =>
this.updateAttribute(
collection["databaseId"],
collection["$id"],
changed,
),
),
),
);
);
} catch (err) {
error(
`Error updating attribute for ${collection["$id"]}: ${String(err)}`,
);
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Error handling swallows failures, causing silent data inconsistency.

The try/catch logs the error but does not propagate it. This means:

  1. If any updateAttribute call fails, execution continues silently
  2. The caller receives no indication that updates failed
  3. Subsequent deletion operations (lines 612-616) proceed without error handling, creating inconsistent behavior

Consider re-throwing after logging, or returning a result that indicates partial failure:

🐛 Proposed fix to propagate errors after logging
     if (changes.length > 0) {
       changedAttributes = changes.map((change) => change.attribute);
       try {
         await Promise.all(
           changedAttributes.map((changed) =>
             this.updateAttribute(
               collection["databaseId"],
               collection["$id"],
               changed,
             ),
           ),
         );
       } catch (err) {
         error(
           `Error updating attribute for ${collection["$id"]}: ${String(err)}`,
         );
+        throw err;
       }
     }
🤖 Prompt for AI Agents
In @lib/commands/utils/attributes.ts around lines 594 - 608, The current
try/catch around Promise.all for changedAttributes swallows errors from
this.updateAttribute (called on collection["databaseId"], collection["$id"]) by
only logging them; change it to propagate the failure so callers know updates
failed—either re-throw the caught error after calling error(...) or convert the
block to return a failure result (e.g., throw new Error or return a rejected
Promise) so subsequent deletion logic does not run on partial failure; ensure
the handler for the Promise.all over changedAttributes preserves the original
error details when propagating.

@abnegate abnegate merged commit 23912c1 into master Jan 13, 2026
1 check passed
@ChiragAgg5k ChiragAgg5k deleted the dev branch January 13, 2026 08:05
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