-
-
Notifications
You must be signed in to change notification settings - Fork 180
Database transactions #199
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
Conversation
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.
we've got a database specific exception class you can throw here
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.
I dont think you need to use the Result type and use https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/-completable-deferred/complete-exceptionally.html instead of throwing
...e-kotlin-sdk into database-transactions
...e-kotlin-sdk into database-transactions
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.
I'm suggesting this change because I think transactions are not working.
We need to work with currentData.value, not with currentData itself.
Also we need to tolerate null value as described in the Firebase documentation.
I'm happy to help to update and merge this PR but I'm not sure I'll be able to do the same in js and iOS.
...base-transactions # Conflicts: # firebase-database/build.gradle.kts
(削除) Should this PR work on iOS? I'm getting this error: Uncaught Kotlin exception: kotlin.native.IncorrectDereferenceException: illegal attempt to access non-shared <object>@xxxx from other thread (削除ここまで)
(削除) I think to make this work on iOS we'll need to freeze the callback blocks: https://youtrack.jetbrains.com/issue/KT-43566 (削除ここまで)
I think to make this work on iOS we'll need to freeze the callback blocks: https://youtrack.jetbrains.com/issue/KT-43566
I wouldnt freeze it, you should be able to enable the new memory model and disable freezing.
https://github.com/JetBrains/kotlin/blob/master/kotlin-native/NEW_MM.md
kotlin.native.binary.memoryModel=experimental
kotlin.native.binary.freezing=disabled
Freezing will be deprecated in future version of Kotlin
No description provided.