You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Functions SDK version 21.1.0 seems to have broken source compatibility. Specifically when using HttpsCallableResult:
Version 21.0.0
suspendfunaddMessage(text:String) {
val data = hashMapOf("text" to text)
val result = functions
.getHttpsCallable("addMessage")
.call(data)
.await()
val data = result?.data // <-- WORKS
}
Version 21.1.0
suspendfunaddMessage(text:String) {
val data = hashMapOf("text" to text)
val result = functions
.getHttpsCallable("addMessage")
.call(data)
.await()
val data = result?.data // <-- Cannot access 'val data: Any?': it is private in 'com/google/firebase/functions/HttpsCallableResult'
}
This seems to be related to how Kotlin coerces Java's functions into field accesses. A java function called foo.getData() can be accessed as foo.data from Kotlin. However, if the code is compiled from Kotlin, you need to explicitly provide the getters. The released changes for Functions should be binary compatible but as shown, not source compatible for Kotlin consumers. This shouldn't affect Java users. Existing tooling doesn't exist to make sure this isn't broken and only focused on Java compatibility. The fix is both fixing this specific case and checking the rest of the SDK for instances where the conversion may have caused this, which I'll work on for the next Firebase release.
[REQUIRED] Step 2: Describe your environment
[REQUIRED] Step 3: Describe the problem
Functions SDK version 21.1.0 seems to have broken source compatibility. Specifically when using
HttpsCallableResult
:Version 21.0.0
Version 21.1.0
Spotted in https://github.com/firebase/quickstart-android/actions/runs/11883012926/job/33109208274
The text was updated successfully, but these errors were encountered: