-
Notifications
You must be signed in to change notification settings - Fork 30
feat: Android SDK update for version 14.0.0 #115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 5 commits
0ad33c7
40eeb4e
b199e60
42f44f1
df364dc
e7e784c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,7 +17,7 @@ data class Row<T>( | |
| * Row sequence ID. | ||
| */ | ||
| @SerializedName("\$sequence") | ||
| val sequence: Long, | ||
| val sequence: String, | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: find . -name "Row.kt" -type f | head -20Repository: appwrite/sdk-for-android Length of output: 117 🏁 Script executed: cd library/src/main/java/io/appwrite/models && ls -la | head -30Repository: appwrite/sdk-for-android Length of output: 1891 🏁 Script executed: wc -l ./library/src/main/java/io/appwrite/models/Row.ktRepository: appwrite/sdk-for-android Length of output: 121 🏁 Script executed: cat -n ./library/src/main/java/io/appwrite/models/Row.ktRepository: appwrite/sdk-for-android Length of output: 3388 🏁 Script executed: rg "map\[" library/src/main/java/io/appwrite/models/*.kt -A 1 -B 1 | head -80Repository: appwrite/sdk-for-android Length of output: 7182 🏁 Script executed: grep -n "as String" library/src/main/java/io/appwrite/models/Row.ktRepository: appwrite/sdk-for-android Length of output: 392 🏁 Script executed: find . -name "jsonCast*" -o -name "*Extension*" | grep -i extension | head -20Repository: appwrite/sdk-for-android Length of output: 326 🏁 Script executed: cat -n ./library/src/main/java/io/appwrite/extensions/JsonExtensions.ktRepository: appwrite/sdk-for-android Length of output: 1345 🏁 Script executed: grep -rn "sequence" library/src/main/java/io/appwrite/models/Row.ktRepository: appwrite/sdk-for-android Length of output: 317 🏁 Script executed: rg "\$sequence" library/ --type java --type kotlin -B 2 -A 2Repository: appwrite/sdk-for-android Length of output: 50 🏁 Script executed: rg "sequence" library/src/test -B 3 -A 3 | head -60Repository: appwrite/sdk-for-android Length of output: 124 🏁 Script executed: find . -name "*.json" -type f | head -10Repository: appwrite/sdk-for-android Length of output: 100 🏁 Script executed: rg "Number" library/src/main/java/io/appwrite/extensions/JsonExtensions.kt -B 2 -A 2Repository: appwrite/sdk-for-android Length of output: 380 🏁 Script executed: rg "as String" library/src/main/java/io/appwrite/models/ | wc -lRepository: appwrite/sdk-for-android Length of output: 71 🏁 Script executed: rg "toLong()" library/src/main/java/io/appwrite/models/ | head -20Repository: appwrite/sdk-for-android Length of output: 2349 🏁 Script executed: cat -n library/src/main/java/io/appwrite/extensions/TypeExtensions.ktRepository: appwrite/sdk-for-android Length of output: 362 🏁 Script executed: rg "Sequence" library/src/main/java/io/appwrite/models/Row.kt -B 3 -A 3Repository: appwrite/sdk-for-android Length of output: 50 🏁 Script executed: git log --oneline library/src/main/java/io/appwrite/models/Row.kt | head -5Repository: appwrite/sdk-for-android Length of output: 110 🏁 Script executed: git show HEAD:library/src/main/java/io/appwrite/models/Row.kt | head -110 | tail -20Repository: appwrite/sdk-for-android Length of output: 745 🏁 Script executed: rg "as String" library/src/main/java/io/appwrite/models/Row.kt -nRepository: appwrite/sdk-for-android Length of output: 392 🏁 Script executed: git diff HEAD~1 library/src/main/java/io/appwrite/models/Row.kt 2>/dev/null || echo "Cannot show diff"Repository: appwrite/sdk-for-android Length of output: 84 Fix unsafe The hard cast Suggested fix- sequence = map["\$sequence"] as String,
+ sequence = when (val rawSequence = map["\$sequence"]) {
+ is String -> rawSequence
+ is Number -> rawSequence.toLong().toString()
+ else -> throw IllegalArgumentException("Invalid \$sequence type: ${rawSequence?.javaClass}")
+ },🤖 Prompt for AI Agents |
||
|
|
||
| /** | ||
| * Table ID. | ||
|
|
@@ -69,7 +69,7 @@ data class Row<T>( | |
| companion object { | ||
| operator fun invoke( | ||
| id: String, | ||
| sequence: Long, | ||
| sequence: String, | ||
| tableId: String, | ||
| databaseId: String, | ||
| createdAt: String, | ||
|
|
@@ -93,7 +93,7 @@ data class Row<T>( | |
| nestedType: Class<T> | ||
| ) = Row<T>( | ||
| id = map["\$id"] as String, | ||
| sequence = (map["\$sequence"] as Number).toLong(), | ||
| sequence = map["\$sequence"] as String, | ||
| tableId = map["\$tableId"] as String, | ||
| databaseId = map["\$databaseId"] as String, | ||
| createdAt = map["\$createdAt"] as String, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Version wasn't bumped