Skip to content

Commit

Permalink
correctly emit channel-closed when Mint.HTTP.stream/2 errors
Browse files Browse the repository at this point in the history
  • Loading branch information
the-mikedavis committed Jul 6, 2021
1 parent 319fd66 commit e7f7b79
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ The format is based on [Keep a
Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to
[Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## 0.8.1 - 2021-07-06

### Fixed

- Properly emit the channel-closed event when `Mint.HTTP.stream/2` returns an
error tuple about the connection being closed

## 0.8.0 - 2021-07-01

### Changed
Expand Down
7 changes: 6 additions & 1 deletion lib/slipstream/connection/pipeline.ex
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,13 @@ defmodule Slipstream.Connection.Pipeline do
|> put_state(%State{p.state | conn: conn})
|> decode_message()

:unknown ->
{:error, conn, %Mint.TransportError{reason: :closed}} ->
# coveralls-ignore-start
p
|> put_state(put_in(p.state.conn, conn))
|> put_message(event(%Events.ChannelClosed{reason: :closed}))

:unknown ->
Logger.error(
"""
unknown message #{inspect(p.raw_message)}
Expand Down

0 comments on commit e7f7b79

Please sign in to comment.