We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c60f8dc commit e005485Copy full SHA for e005485
packages/firestore/src/util/bundle_reader.ts
@@ -96,7 +96,7 @@ export class BundleReader {
96
this.reader = (this.bundleStream as ReadableStream).getReader();
97
98
// Read the metadata (which is the first element).
99
- this.nextElement().then(
+ this.nextElementImpl().then(
100
element => {
101
if (element && element.isBundleMetadata()) {
102
this.metadata.resolve(element.payload.metadata!);
@@ -125,6 +125,8 @@ export class BundleReader {
125
* have reached the end of the stream.
126
*/
127
async nextElement(): Promise<SizedBundleElement | null> {
128
+ // Makes sure metadata is read before proceeding.
129
+ await this.getMetadata();
130
return this.nextElementImpl();
131
}
132
0 commit comments