Skip to content
This repository was archived by the owner on Mar 4, 2026. It is now read-only.

Don't call stream.end() on Watch ended by server#565

Merged
schmidt-sebastian merged 2 commits intomasterfrom
mrschmidt-watchend
Mar 5, 2019
Merged

Don't call stream.end() on Watch ended by server#565
schmidt-sebastian merged 2 commits intomasterfrom
mrschmidt-watchend

Conversation

@schmidt-sebastian
Copy link
Copy Markdown
Contributor

@schmidt-sebastian schmidt-sebastian commented Mar 5, 2019

This is part of #564

The changes in #564 to make formattedName() async changed a lot of the timing in the Watch code and uncovered an issue with the way we close streams. We should only call stream.end() if the SDK closes the stream. If the server closes the stream we don't call end() - if we do, we get an exception (that was previously swallowed).

This PR also introduces subclasses for Watch that provide the Target Proto and the Comaprator. This makes it possible to construct these after initialization time and to return a Promise.

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

codecov Bot commented Mar 5, 2019

Codecov Report

Merging #565 into master will decrease coverage by 0.07%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #565      +/-   ##
==========================================
- Coverage   95.85%   95.77%   -0.08%     
==========================================
  Files          24       24              
  Lines        1931     1943      +12     
  Branches      168      168              
==========================================
+ Hits         1851     1861      +10     
- Misses         57       59       +2     
  Partials       23       23
Impacted Files Coverage Δ
dev/src/watch.ts 98.19% <100%> (-0.86%) ⬇️
dev/src/reference.ts 99.68% <100%> (ø) ⬆️

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 4ceac71...7e1c3fa. Read the comment docs.

@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 5, 2019

Codecov Report

Merging #565 into master will increase coverage by 0.02%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #565      +/-   ##
==========================================
+ Coverage   95.85%   95.88%   +0.02%     
==========================================
  Files          24       24              
  Lines        1931     1943      +12     
  Branches      168      168              
==========================================
+ Hits         1851     1863      +12     
  Misses         57       57              
  Partials       23       23
Impacted Files Coverage Δ
dev/src/watch.ts 99.09% <100%> (+0.05%) ⬆️
dev/src/reference.ts 99.68% <100%> (ø) ⬆️

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 c92e1cf...4ff3895. Read the comment docs.

@schmidt-sebastian
Copy link
Copy Markdown
Contributor Author

I'm gonna leave this unmerged for a bit to give @mikelehen a chance to comment.

Copy link
Copy Markdown
Contributor

@mikelehen mikelehen left a comment

Choose a reason for hiding this comment

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

LGTM

@schmidt-sebastian schmidt-sebastian merged commit 04eb91c into master Mar 5, 2019
@schmidt-sebastian schmidt-sebastian deleted the mrschmidt-watchend branch March 11, 2019 03:08
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants