From e318923d318151e503de03be53aef1a0cffc58e3 Mon Sep 17 00:00:00 2001 From: rsgowman Date: Mon, 28 May 2018 16:42:23 -0400 Subject: "Handle" BatchGetDocumentsResponse.transaction (by ignoring it) (#1318) --- .../core/src/firebase/firestore/remote/serializer.cc | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'Firestore/core/src/firebase/firestore') diff --git a/Firestore/core/src/firebase/firestore/remote/serializer.cc b/Firestore/core/src/firebase/firestore/remote/serializer.cc index 6ea5844..e06dcb4 100644 --- a/Firestore/core/src/firebase/firestore/remote/serializer.cc +++ b/Firestore/core/src/firebase/firestore/remote/serializer.cc @@ -504,7 +504,7 @@ std::unique_ptr Serializer::DecodeBatchGetDocumentsResponse( // Initialize BatchGetDocumentsResponse fields to their default values std::unique_ptr found; std::string missing; - // TODO(rsgowman): transaction + // We explicitly ignore the 'transaction' field SnapshotVersion read_time = SnapshotVersion::None(); while (reader->bytes_left()) { @@ -515,6 +515,7 @@ std::unique_ptr Serializer::DecodeBatchGetDocumentsResponse( switch (tag.field_number) { case google_firestore_v1beta1_BatchGetDocumentsResponse_found_tag: case google_firestore_v1beta1_BatchGetDocumentsResponse_missing_tag: + case google_firestore_v1beta1_BatchGetDocumentsResponse_transaction_tag: case google_firestore_v1beta1_BatchGetDocumentsResponse_read_time_tag: if (tag.wire_type != PB_WT_STRING) { reader->set_status( @@ -524,10 +525,6 @@ std::unique_ptr Serializer::DecodeBatchGetDocumentsResponse( } break; - case google_firestore_v1beta1_BatchGetDocumentsResponse_transaction_tag: - // TODO(rsgowman) - abort(); - default: reader->set_status(Status( FirestoreErrorCode::DataLoss, @@ -559,8 +556,13 @@ std::unique_ptr Serializer::DecodeBatchGetDocumentsResponse( break; case google_firestore_v1beta1_BatchGetDocumentsResponse_transaction_tag: - // TODO(rsgowman) - abort(); + // This field is ignored by the client sdk, but we still need to extract + // it. + // TODO(rsgowman) switch this to reader->SkipField() (or whatever we end + // up calling it) once that exists. Possibly group this with other + // ignored and/or unknown fields + reader->ReadString(); + break; case google_firestore_v1beta1_BatchGetDocumentsResponse_read_time_tag: read_time = SnapshotVersion{ -- cgit v1.2.3