Skip to content

Commit 437144d

Browse files
committed
format
1 parent 1b16c7a commit 437144d

File tree

2 files changed

+9
-166
lines changed

2 files changed

+9
-166
lines changed

firebase-firestore/src/main/java/com/google/firebase/firestore/remote/RemoteSerializer.java

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -149,10 +149,8 @@ private String encodeQueryPath(ResourcePath path) {
149149
private ResourcePath decodeQueryPath(String name) {
150150
ResourcePath resource = decodeResourceName(name);
151151
if (resource.length() == 4) {
152-
// In v1beta1 queries for collections at the root did not have a trailing
153-
// "/documents". In v1
154-
// all resource paths contain "/documents". Preserve the ability to read the v1
155-
// form for
152+
// In v1beta1 queries for collections at the root did not have a trailing "/documents". In v1
153+
// all resource paths contain "/documents". Preserve the ability to read the v1 form for
156154
// compatibility with queries persisted in the local query cache.
157155
return ResourcePath.EMPTY;
158156
} else {
@@ -435,12 +433,9 @@ private FieldTransform decodeFieldTransform(DocumentTransform.FieldTransform fie
435433

436434
public MutationResult decodeMutationResult(
437435
com.google.firestore.v1.WriteResult proto, SnapshotVersion commitVersion) {
438-
// NOTE: Deletes don't have an updateTime but the commit timestamp from the
439-
// containing
440-
// CommitResponse or WriteResponse indicates essentially that the delete
441-
// happened no later than
442-
// that. For our purposes we don't care exactly when the delete happened so long
443-
// as we can tell
436+
// NOTE: Deletes don't have an updateTime but the commit timestamp from the containing
437+
// CommitResponse or WriteResponse indicates essentially that the delete happened no later than
438+
// that. For our purposes we don't care exactly when the delete happened so long as we can tell
444439
// when an update on the watch stream is at or later than that change.
445440
SnapshotVersion version = decodeVersion(proto.getUpdateTime());
446441
if (SnapshotVersion.NONE.equals(version)) {
@@ -499,8 +494,7 @@ public Target encodeTarget(TargetData targetData) {
499494

500495
if (targetData.getResumeToken().isEmpty()
501496
&& targetData.getSnapshotVersion().compareTo(SnapshotVersion.NONE) > 0) {
502-
// TODO(wuandy): Consider removing above check because it is most likely true.
503-
// Right now, many
497+
// TODO(wuandy): Consider removing above check because it is most likely true. Right now, many
504498
// tests depend on this behaviour though (leaving min() out of serialization).
505499
builder.setReadTime(encodeTimestamp(targetData.getSnapshotVersion().getTimestamp()));
506500
} else {
@@ -657,8 +651,7 @@ private StructuredQuery.Filter encodeFilters(List<Filter> filters) {
657651
private List<Filter> decodeFilters(StructuredQuery.Filter proto) {
658652
Filter result = decodeFilter(proto);
659653

660-
// Instead of a singletonList containing AND(F1, F2, ...), we can return a list
661-
// containing F1,
654+
// Instead of a singletonList containing AND(F1, F2, ...), we can return a list containing F1,
662655
// F2, ... to stay consistent with the older SDK versions.
663656
if (result instanceof com.google.firebase.firestore.core.CompositeFilter) {
664657
com.google.firebase.firestore.core.CompositeFilter compositeFilter =
@@ -968,10 +961,8 @@ public WatchChange decodeWatchChange(ListenResponse protoChange) {
968961
}
969962

970963
public SnapshotVersion decodeVersionFromListenResponse(ListenResponse watchChange) {
971-
// We have only reached a consistent snapshot for the entire stream if there is
972-
// a read_time set
973-
// and it applies to all targets (i.e. the list of targets is empty). The
974-
// backend is guaranteed
964+
// We have only reached a consistent snapshot for the entire stream if there is a read_time set
965+
// and it applies to all targets (i.e. the list of targets is empty). The backend is guaranteed
975966
// to send such responses.
976967
if (watchChange.getResponseTypeCase() != ResponseTypeCase.TARGET_CHANGE) {
977968
return SnapshotVersion.NONE;

0 commit comments

Comments
 (0)