Repository navigation
feat: Rust SDK update for version 0.20.0 - #37
Conversation
🔵 Tier A · Mergeable after minor fixes
This release updates the Rust SDK to Appwrite API response format 2.5.0 and refreshes its generated models and service methods. It also adds query aggregation and building helpers, MQTT topic construction, single-request uploads, and newer database, proxy, auth, domain, and WAF APIs. 325 of 411 changed files were too large to include in full.
Note Not approving while a bug finding is open: Check pagination offset multiplication for overflow Fix with agent prompt### Issue 1
src/query/mod.rs:700
**Check pagination offset multiplication for overflow**
For accepted `u32` inputs where `(page - 1) * per_page` exceeds `u32::MAX`, this multiplication panics in debug builds and wraps to a smaller offset in release builds. For example, `Query::page(u32::MAX, 2)` cannot produce the requested page and may panic instead.
### Issue 2
src/query/builder.rs:507-518
**Builder omits nested join variants**
`Query` provides `join_on`, `right_join_on`, and `full_outer_join_on`, but `Builder` only forwards `left_join_on`. Callers cannot chain the other supported multi-condition joins into a builder-produced query list.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.📂 Walkthrough · 6
⏳ Still open from earlier reviews · 2
🔇 Filtered out · 1Findings Hansi considered but did not post.
Reviewed |
|
@hansi-codes review |
| if per_page < 1 { | ||
| panic!("Per page must be >= 1, got {}", per_page); | ||
| } | ||
| vec![Self::limit(per_page), Self::offset((page - 1) * per_page)] |
There was a problem hiding this comment.
Check pagination offset multiplication for overflow
For accepted u32 inputs where (page - 1) * per_page exceeds u32::MAX, this multiplication panics in debug builds and wraps to a smaller offset in release builds. For example, Query::page(u32::MAX, 2) cannot produce the requested page and may panic instead.
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/query/mod.rs
Line: 700
Comment:
**Check pagination offset multiplication for overflow**
For accepted `u32` inputs where `(page - 1) * per_page` exceeds `u32::MAX`, this multiplication panics in debug builds and wraps to a smaller offset in release builds. For example, `Query::page(u32::MAX, 2)` cannot produce the requested page and may panic instead.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.🟡 Minor · bug · Reply if this doesn't apply.
| pub fn left_join_on<I, S>( | ||
| mut self, | ||
| table: impl Into<String>, | ||
| alias: impl Into<String>, | ||
| on: I, | ||
| ) -> Self | ||
| where | ||
| I: IntoIterator<Item = S>, | ||
| S: AsRef<str>, | ||
| { | ||
| self.queries.push(Query::left_join_on(table, alias, on)); | ||
| self |
There was a problem hiding this comment.
Builder omits nested join variants
Query provides join_on, right_join_on, and full_outer_join_on, but Builder only forwards left_join_on. Callers cannot chain the other supported multi-condition joins into a builder-produced query list.
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/query/builder.rs
Line: 507-518
Comment:
**Builder omits nested join variants**
`Query` provides `join_on`, `right_join_on`, and `full_outer_join_on`, but `Builder` only forwards `left_join_on`. Callers cannot chain the other supported multi-condition joins into a builder-produced query list.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.🟡 Minor · bug · Reply if this doesn't apply.
|
@hansi-codes review |
This PR contains updates to the SDK for version 0.20.0.
What's Changed
2.5.0;Project.dev_keyswas removedaccount.list_logsandusers.list_logswith theLogandLogListmodelsorganization.create_key,get_key,list_keys,update_keyanddelete_key, andOrganizationKeyScopes; useorganization.list_project_keys,get_project_key,update_project_keyanddelete_project_keyinsteadBillingPlanGroup::Starter; useBillingPlanGroup::Freeproject.update_o_auth2_kakaotakesenabledbeforepromptExecutionMethod::default()is nowPOST, the spec default, instead ofGETBlockfieldsproject_name,region,organization_name,organization_id,billing_planandreasonlist_specificationsreturns each specification's prices and overage rates on the row itself. Removed the list-levelpricingfield and theDedicatedDatabaseSpecificationPricingmodelBackupRestoration.optionsis aserde_json::Value, not aStringOptionprompt,native_client_ids,native_enabled,fingerprintsand similar fields are no longerOptionfunctions.updatetakesemail_enabledmongo,mysqlandpostgresqlcreate_restorationtakerestore_mode,target_nameandauto_promoteaftertarget_timeClient::single_uploadfor endpoints that take a file in one requestTopichelper to build MQTT topics for push messagesmongo,mysqlandpostgresqlpromote_restoration, andDedicatedDatabaseRestoration.restore_modeproxy.create_smtp_rule, theProxyRuleProtocolenum andProxyRule.protocolFunction.email_enabledandExecutionTrigger::EmailQueryaggregates (count,count_distinct,sum,avg,min,maxand more),group_by,having,distinct, joins,relationship,covers,spatial_equalsandpageQuery::builder()to chain queries into a list