Skip to content

feat: Android SDK update for version 24.1.1#124

Merged
abnegate merged 2 commits into
mainfrom
dev
May 19, 2026
Merged

feat: Android SDK update for version 24.1.1#124
abnegate merged 2 commits into
mainfrom
dev

Conversation

@ArnabChatterjee20k
Copy link
Copy Markdown
Member

@ArnabChatterjee20k ArnabChatterjee20k commented May 19, 2026

This PR contains updates to the Android SDK for version 24.1.1.

What's Changed

  • Fixed: Removed Advisor service and Insight, InsightCTA, InsightList, Report, ReportList models (admin-only endpoints, not intended for client SDKs)
  • Added: sizeActual field to File model

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented May 19, 2026

Greptile Summary

This PR bumps the Android SDK to version 24.1.1. It removes the Advisor service and its five associated models (Insight, InsightCTA, InsightList, Report, ReportList) which were admin-only endpoints mistakenly included in the client SDK, and adds a new sizeActual field to the File model.

  • Advisor removal: Advisor.kt and all related models and example docs are fully deleted; the corresponding CHANGELOG entry and README version references are correctly updated.
  • sizeActual in File.kt: The field is declared Long (non-nullable) and deserialized with (map["sizeActual"] as Number).toLong(), which will throw a ClassCastException at runtime on any server that does not yet include this field in its response.
  • x-appwrite-response-format: The header in Client.kt remains 1.9.5 after the version bump — worth verifying this is intentional and matches the supported server response schema.

Confidence Score: 4/5

Merging 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

Filename Overview
library/src/main/java/io/appwrite/models/File.kt Adds non-nullable sizeActual: Long field; the from() factory performs a hard cast that will throw ClassCastException if the key is absent (e.g. older server versions)
library/src/main/java/io/appwrite/services/Advisor.kt Deleted — admin-only service correctly removed from the client SDK
library/src/main/java/io/appwrite/Client.kt Version header bumped from 24.1.0 to 24.1.1; x-appwrite-response-format unchanged at 1.9.5
CHANGELOG.md 24.1.1 entry added documenting the Advisor removal and sizeActual addition
README.md Version references updated from 24.1.0 to 24.1.1 in both Gradle and Maven snippets

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(),
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 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.

@abnegate abnegate merged commit c99ae1b into main May 19, 2026
1 check passed
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