-
Notifications
You must be signed in to change notification settings - Fork 439
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
Firestore : Protobuf error when transactionID is null #891
Comments
Can you run |
|
I'm having trouble triggering the error you've described. Can you try this and let me know if it fixes the issue? In public function beginTransaction(array $args)
{
$rw = new TransactionOptions_ReadWrite;
if ($retry = $this->pluck('retryTransaction', $args, false)) {
$rw->setRetryTransaction($retry);
}
$args['options'] = new TransactionOptions;
$args['options']->setReadWrite($rw);
return $this->send([$this->firestore, 'beginTransaction'], [
$this->pluck('database', $args),
$this->addResourcePrefixHeader($args)
]);
} (Be sure you make this change in a clean copy of the library, WITHOUT the changes proposed in your pull request.) |
@lemonlab any luck with the code I shared? |
Works perfectly, thank you ! |
Great! I'll get a bugfix in. Thanks for the report. |
When using the C implementation of protobuf, we can not use transactions in firestore, because protobuf is expecting a string for the transaction ID, and it may be null.
Exception :
User Error: Given value cannot be converted to string.
See : https://github.com/GoogleCloudPlatform/google-cloud-php/blob/master/src/Firestore/FirestoreClient.php#L438
Steps to reproduce :
1 - Makes sure to use the C implementation of protobuf
pecl install protobuf
2 - Create a Firebase transaction
An exception is raise even if the transaction contains no operation inside.
Stack trace
The text was updated successfully, but these errors were encountered: