Skip to content
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 SnapshotTrait::getSnapshot() Timestamp inconsistency #5806

Closed
yash30201 opened this issue Jan 23, 2023 · 0 comments · Fixed by #5807
Closed

Firestore SnapshotTrait::getSnapshot() Timestamp inconsistency #5806

yash30201 opened this issue Jan 23, 2023 · 0 comments · Fixed by #5807
Assignees
Labels
api: firestore Issues related to the Firestore API.

Comments

@yash30201
Copy link
Contributor

Environment details

  • OS:Linux
  • PHP version:8.1

Steps to reproduce

Simply try to fetch a DocumentSnapshot with readTime parameter in firestore.

Code example

use Google\Cloud\Core\Timestamp;
$readTime = new Timestamp(new \DateTimeImmutable());
$document = $firestoreClient->document('your-document-name');
$snapshot = $document->snapshot(['readTime' => $readTime]);

Doing the above results in error: Google.Protobuf.Timestamp expected error from backend.

if we try to supply Google\Protobuf\Timestamp, then we get a client level exception from getSnapshot() method saying Google\Cloud\Core\Timestamp expected.

Bug

Thus right now it's not possible to use readTime parameter in getSnapshot method in client library.

@yash30201 yash30201 added the api: firestore Issues related to the Firestore API. label Jan 23, 2023
@yash30201 yash30201 self-assigned this Jan 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: firestore Issues related to the Firestore API.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant