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: refresh iam tokens in websocket methods #913

Merged
merged 2 commits into from
Jul 17, 2019

Conversation

dpopp07
Copy link
Contributor

@dpopp07 dpopp07 commented Jul 15, 2019

It occurred to me the other day that, in the websocket methods, there is no need to wrap the token request logic in an "is authenticated" style boolean variable. If the same Stream class is closed and used to open another connection, the token could not be refreshed. Also, if the token is stored and not expired, there is no performance hit from the logic because the token manager will give back the stored token.

This is a small change but I felt like it was worth it to make.

@codecov-io
Copy link

codecov-io commented Jul 17, 2019

Codecov Report

Merging #913 into master will decrease coverage by 1.32%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #913      +/-   ##
=========================================
- Coverage   54.03%   52.7%   -1.33%     
=========================================
  Files          18      18              
  Lines        4466    4614     +148     
  Branches      907     952      +45     
=========================================
+ Hits         2413    2432      +19     
- Misses       2051    2180     +129     
  Partials        2       2
Impacted Files Coverage Δ
lib/recognize-stream.ts 44.57% <100%> (-21.09%) ⬇️
lib/synthesize-stream.ts 82.75% <100%> (-2.25%) ⬇️
speech-to-text/v1.ts 28.76% <0%> (-3.06%) ⬇️
test/resources/auth_helper.js 100% <0%> (+22.22%) ⬆️

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 9696f62...9a85812. Read the comment docs.

@dpopp07 dpopp07 merged commit 5a2876a into master Jul 17, 2019
@dpopp07 dpopp07 deleted the refresh-token-websockets branch July 17, 2019 21:31
watson-github-bot pushed a commit that referenced this pull request Jul 17, 2019
## [4.2.4](v4.2.3...v4.2.4) (2019-07-17)

### Bug Fixes

* refresh iam tokens in websocket methods ([#913](#913)) ([5a2876a](5a2876a))
@watson-github-bot
Copy link
Member

🎉 This PR is included in version 4.2.4 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

None yet

4 participants