feat: .NET SDK update for version 4.1.0#93
Conversation
Greptile SummaryThis PR updates the .NET SDK to version 4.1.0, adding new Deno runtime variants, a
Confidence Score: 4/5The nullable BillingLimits changes are incomplete — both BillingLimits.From and Project.From still use direct dictionary indexing that throws at runtime when the server omits a key, which is exactly the sparse-map scenario this change was designed to handle. The enum additions, File.SizeActual, version bumps, and documentation fixes are all clean. The risk is concentrated in the BillingLimits deserialization path: direct map["key"] access in From() will throw KeyNotFoundException for any field the server omits from a sparse response, and Project.From unconditionally calls BillingLimits.From without guarding against a missing or null billingLimits key. Until those guards are in place, any response that omits billing data will cause a runtime crash. Appwrite/Models/BillingLimits.cs and Appwrite/Models/Project.cs — the null-guard logic in their From() methods needs to use TryGetValue or ContainsKey instead of direct dictionary indexing to safely handle sparse server responses. Important Files Changed
Reviews (2): Last reviewed commit: "feat: update .NET SDK to 4.1.0" | Re-trigger Greptile |
| public static BillingLimits From(Dictionary<string, object> map) => new BillingLimits( | ||
| bandwidth: Convert.ToInt64(map["bandwidth"]), | ||
| storage: Convert.ToInt64(map["storage"]), | ||
| users: Convert.ToInt64(map["users"]), | ||
| executions: Convert.ToInt64(map["executions"]), | ||
| gBHours: Convert.ToInt64(map["GBHours"]), | ||
| imageTransformations: Convert.ToInt64(map["imageTransformations"]), | ||
| authPhone: Convert.ToInt64(map["authPhone"]), | ||
| budgetLimit: Convert.ToInt64(map["budgetLimit"]) | ||
| bandwidth: map["bandwidth"] == null ? null : Convert.ToInt64(map["bandwidth"]), | ||
| storage: map["storage"] == null ? null : Convert.ToInt64(map["storage"]), | ||
| users: map["users"] == null ? null : Convert.ToInt64(map["users"]), | ||
| executions: map["executions"] == null ? null : Convert.ToInt64(map["executions"]), | ||
| gBHours: map["GBHours"] == null ? null : Convert.ToInt64(map["GBHours"]), | ||
| imageTransformations: map["imageTransformations"] == null ? null : Convert.ToInt64(map["imageTransformations"]), | ||
| authPhone: map["authPhone"] == null ? null : Convert.ToInt64(map["authPhone"]), | ||
| budgetLimit: map["budgetLimit"] == null ? null : Convert.ToInt64(map["budgetLimit"]) | ||
| ); |
There was a problem hiding this comment.
Sparse-map access will throw
KeyNotFoundException
The CHANGELOG explicitly states the server emits a sparse "limits crossed" map — only fields that have been exceeded are included. Accessing map["bandwidth"] on a dictionary where the key is absent throws KeyNotFoundException, not null. The existing null check (== null) only protects against an explicitly null value, not a missing key. When all limits are within bounds and the server returns an empty or partial object, deserialization will fail at runtime for every missing field.
* Added `Deno121`, `Deno124`, and `Deno135` runtime support to `BuildRuntime` and `Runtime` enums * Added `SizeActual` property to `File` model for tracking actual file sizes * Breaking: Changed `BillingLimits` properties to nullable types in constructor and model * Breaking: Changed `BillingLimits` property to nullable in `Project` model * Updated advisor authentication examples to use API key instead of session
ChiragAgg5k
left a comment
There was a problem hiding this comment.
LGTM. Auto-generated SDK updates consistent with the matching PRs in the other language SDKs (SizeActual on File, BillingLimits properties nullable, Deno121/124/135 added, advisor docs switched to API key auth, version + changelog bump). Breaking-change tags in the changelog match the reality of the nullable property changes.
This PR contains updates to the .NET SDK for version 4.1.0.
Changes
Deno121,Deno124, andDeno135runtime support toBuildRuntimeandRuntimeenumsSizeActualproperty toFilemodel for tracking actual file sizesBillingLimitsproperties to nullable types in constructor and modelBillingLimitsproperty to nullable inProjectmodel