Conversation
Greptile SummaryThis PR bumps the Android SDK to version 24.1.1. It removes the
Confidence Score: 4/5Merging will crash any app that calls a File-returning API while still connected to a pre-24.1.1 Appwrite server, because sizeActual is missing from older responses and the hard cast in File.from() is not guarded. The Advisor removal and version bumps are clean. The risk is entirely in File.kt: sizeActual is deserialized with an unguarded (map["sizeActual"] as Number).toLong(), which throws a ClassCastException whenever the key is absent — a realistic scenario for any client app that upgrades the SDK before the Appwrite server is updated. library/src/main/java/io/appwrite/models/File.kt — the sizeActual deserialization needs a safe-cast fallback to avoid crashing on older server versions. Important Files Changed
Reviews (2): Last reviewed commit: "chore: update Android SDK to 24.1.1" | Re-trigger Greptile |
| signature = map["signature"] as String, | ||
| mimeType = map["mimeType"] as String, | ||
| sizeOriginal = (map["sizeOriginal"] as Number).toLong(), | ||
| sizeActual = (map["sizeActual"] as Number).toLong(), |
There was a problem hiding this comment.
Non-nullable
sizeActual will crash on older server versions
sizeActual is deserialized with a hard cast: (map["sizeActual"] as Number).toLong(). Any app upgrading to SDK 24.1.1 while still pointing at a pre-24.1.1 Appwrite server will receive a response that omits this key entirely. map["sizeActual"] then returns null, and (null as Number) throws a ClassCastException at runtime — crashing on every call that returns a File object. The field should either be nullable (Long?) or fall back to a safe default (e.g. (map["sizeActual"] as? Number)?.toLong() ?: 0L) to preserve backward compatibility.
This PR contains updates to the Android SDK for version 24.1.1.
What's Changed
Advisorservice andInsight,InsightCTA,InsightList,Report,ReportListmodels (admin-only endpoints, not intended for client SDKs)sizeActualfield toFilemodel