Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: cancel streaming grpc request when user ends stream #507

Merged
merged 4 commits into from Jul 31, 2019

Conversation

stephenplusplus
Copy link
Contributor

Fixes #506

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Jul 10, 2019
@codecov
Copy link

codecov bot commented Jul 10, 2019

Codecov Report

Merging #507 into master will decrease coverage by 0.05%.
The diff coverage is 90%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #507      +/-   ##
==========================================
- Coverage   97.85%   97.79%   -0.06%     
==========================================
  Files          10       10              
  Lines        1303     1313      +10     
  Branches      345      347       +2     
==========================================
+ Hits         1275     1284       +9     
- Partials       28       29       +1
Impacted Files Coverage Δ
src/table.ts 98.46% <90%> (-0.27%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4e02ff5...4bffd22. Read the comment docs.

@@ -87,6 +87,9 @@ describe('Read Row Acceptance tests', function() {
objectMode: true,
});

/* tslint:disable-next-line */
(stream as any).abort = function() {};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe nodejs-common has an AbortableDuplex interface that should work here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JustinBeckwith could you take a look if I went about this the right way? I had to add a devDependency on common, and cast the PassThrough streams to Duplex streams. It started to feel wrong :)

package.json Outdated
@@ -69,6 +69,7 @@
"through2": "^3.0.0"
},
"devDependencies": {
"@google-cloud/common": "^2.0.4",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ugh. This will cause problems. Back the way it was! The any will do fine.

@callmehiphop
Copy link
Contributor

LGTM if @JustinBeckwith is happy with it!

Copy link
Contributor

@bcoe bcoe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@stephenplusplus stephenplusplus merged commit 2b4297c into googleapis:master Jul 31, 2019
@stephenplusplus stephenplusplus deleted the spp--506 branch July 31, 2019 19:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cancelling a read row stream doesn't cancel the underlying grpc stream
5 participants