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 #916 Logger given to WebClient is destructively modified #917

Merged
merged 1 commit into from
Nov 28, 2019

Conversation

seratch
Copy link
Member

@seratch seratch commented Nov 27, 2019

Summary

This pull request fixes #916. Refer to the issue for details.

Requirements (place an x in each [ ])

@seratch seratch self-assigned this Nov 27, 2019
@seratch seratch added bug M-T: A confirmed bug report. Issues are confirmed when the reproduction steps are documented pkg:web-api applies to `@slack/web-api` labels Nov 27, 2019
@codecov
Copy link

codecov bot commented Nov 27, 2019

Codecov Report

Merging #917 into master will decrease coverage by 0.24%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #917      +/-   ##
==========================================
- Coverage   95.17%   94.92%   -0.25%     
==========================================
  Files          12       12              
  Lines         725      729       +4     
  Branches      164      166       +2     
==========================================
+ Hits          690      692       +2     
  Misses         13       13              
- Partials       22       24       +2
Flag Coverage Δ
#eventsapi 89.61% <ø> (ø) ⬆️
#interactivemessages 95.22% <ø> (ø) ⬆️
#webapi 97.8% <ø> (-0.72%) ⬇️
#webhook 87.5% <ø> (ø) ⬆️
Impacted Files Coverage Δ
src/logger.ts 84.61% <0%> (-7.7%) ⬇️
src/WebClient.ts 98% <0%> (-0.47%) ⬇️

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 f96e332...e68a7e1. Read the comment docs.

Copy link
Member

@stevengill stevengill left a comment

Choose a reason for hiding this comment

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

Nice fix! LGTM

if (typeof logger !== 'undefined') {
this.logger = logger;
if (typeof logLevel !== 'undefined') {
this.logger.debug('The logLevel given to WebClient was ignored as you also gave logger');
Copy link
Member

Choose a reason for hiding this comment

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

So the loglevel parameter is useless in this instance because by passing in logger, it is assumed it already has a loglevel set

@seratch
Copy link
Member Author

seratch commented Nov 28, 2019

Thanks for your review. I don't think this is an urgent one but it'll be great if we could have a new release of both @slack/web-api and @slack/bolt soon.

@seratch seratch merged commit 95a5618 into slackapi:master Nov 28, 2019
@seratch seratch deleted the avoid-destructive-op-to-logger branch November 28, 2019 01:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug M-T: A confirmed bug report. Issues are confirmed when the reproduction steps are documented pkg:web-api applies to `@slack/web-api`
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Logger given to WebClient is destructively modified
2 participants