github / github/gh-gei

Dispose HTTP response in BbsClient and AdoClient

Open
#926 0 comments 0 reactions 0 assignees View on GitHub
task tech debt
Dominant language
C#
Stars
478
Forks
146
Avg merge
7d 21h
Merged PRs (30d)
2

Description

I noticed that in `BbsClient` and `AdoClient` we are not disposing the HTTP response that is getting returned by the `HttpClient`. The response needs to be immediately disposed with a `using` statement and also all unit tests need to be fixed the way they were fixed in #925.

## Todo
- [ ] Dispose the http response in `BbsClient#SendAsync()` and `AdoClient#SendAsync()` methods
- [ ] Fix unit tests by using a factory to return a new `HttpResponseMessage` when mocking `HttpMessageHandler` (see #925)
- [ ] _Bonus:_ Simplify `SendAsync` method in both `BbsClient` and `AdoClient` by replacing the switch statement with `HttpClient#SendAsync()` the way it is in [GithubClient#SendAsync()](https://github.com/github/gh-gei/blob/main/src/Octoshift/GithubClient.cs#L161).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.