appwrite/sdk-generator

๐Ÿ› Bug Report: [Android] [Realtime Feature] Subscribing to a cloud function execution - Missing ID and read parameters when using the Execution class as payloadType

SebastianTMo opened this issue ยท 1 comments

๐Ÿ‘Ÿ Reproduction steps

[Appwrite Version 0.12]
[Android SDK Version 0.3.2]

Try to subscribe to a Cloud Function Execution using the Execution class as payloadType, process the payload data in the callback function.

๐Ÿ‘ Expected behavior

Having all relevant data available as per:
https://appwrite.io/docs/models/execution

๐Ÿ‘Ž Actual Behavior

ID and read paramenters are null.

Root cause seems to be missing annotations for below two lines:

https://github.com/appwrite/sdk-for-android/blob/7c78fa58bdc97b913a959d6f326874423855f739/library/src/main/java/io/appwrite/models/Execution.kt#L11

and

https://github.com/appwrite/sdk-for-android/blob/7c78fa58bdc97b913a959d6f326874423855f739/library/src/main/java/io/appwrite/models/Execution.kt#L17

Workaround: Using a custom data class with the appropriate annotations, e.g.:

import com.google.gson.annotations.SerializedName

data class ExecutionObjectResponse(
    val dateCreated: Long,
    val exitCode: Long,
    val functionId: String,
    @SerializedName("\$id")
    val id: String,
    @SerializedName("\$read")
    val read: List<String>,
    val status: String,
    val stderr: String,
    val stdout: String,
    val time: Double,
    val trigger: String
)

๐ŸŽฒ Appwrite version

Different version (specify in environment)

๐Ÿ’ป Operating system

Linux

๐Ÿงฑ Your Environment

No response

๐Ÿ‘€ Have you spent some time to check if this issue has been raised before?

  • I checked and didn't find similar issue

๐Ÿข Have you read the Code of Conduct?

Fixed in version 0.3.3 ๐Ÿฅณ