Skip to content

Commit aa62e43

Browse files
authored
Add comment regarding presence of '/documents' to fromQueryPath(). (#1474)
1 parent 2e0d0ad commit aa62e43

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

packages/firestore/src/remote/serializer.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,10 @@ export class JsonProtoSerializer {
345345

346346
fromQueryPath(name: string): ResourcePath {
347347
const resourceName = this.fromResourceName(name);
348+
// In v1beta1 queries for collections at the root did not have a trailing
349+
// "/documents". In v1 all resource paths contain "/documents". Preserve the
350+
// ability to read the v1beta1 form for compatibility with queries persisted
351+
// in the local query cache.
348352
if (resourceName.length === 4) {
349353
return ResourcePath.EMPTY_PATH;
350354
}

0 commit comments

Comments
 (0)