From 0822e4d17d28e47b5377d6d3853a4c5bc125a2e9 Mon Sep 17 00:00:00 2001 From: danieljbruce Date: Fri, 27 Jan 2023 15:34:45 -0500 Subject: [PATCH] fix: pipe metadata along (#1178) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * pipe metadata along * Arrange imports back to where they were * revert some automatic imports * revert automatic import * report metadata when it doesn’t exist yet * should include metadata in result * Remove only * Removed setting metadata that is no longer used * Add an assert fail * Better check for metadata * use bind instead * revert changes for exposing metadata directly * change stream emit metadata back --- src/index.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/index.ts b/src/index.ts index 5f01e2a4d..80bc710d5 100644 --- a/src/index.ts +++ b/src/index.ts @@ -863,6 +863,7 @@ export class Bigtable { gaxStream = requestFn!(); gaxStream .on('error', stream.destroy.bind(stream)) + .on('metadata', stream.emit.bind(stream, 'metadata')) .on('request', stream.emit.bind(stream, 'request')) .pipe(stream); }); @@ -879,6 +880,9 @@ export class Bigtable { .on('error', (err: Error) => { stream.destroy(err); }) + .on('metadata', metadata => { + stream.emit('metadata', metadata); + }) .on('response', response => { stream.emit('response', response); })