Releases: launchdarkly/ruby-eventsource
Releases · launchdarkly/ruby-eventsource
2.2.2
[2.2.2] - 2023-03-13
Fixed:
- Content-Type checking was failing in some environments due to casing issues. Updated check to use a more robust header retrieval method. (Thanks, matt-dutchie!)
2.2.1
2.2.0
[2.2.0] - 2021-12-31
Added:
- The
StreamEvent
type now has a new property,last_event_id
. Unlike theid
property which reports only the value of theid:
field (if any) in that particular event,last_event_id
reports theid:
value that was most recently specified in any event. The specification states that this state should be included in every event; the ability to distinguishlast_event_id
fromid
is an extended feature of this gem.
Fixed:
- The client could stop reading the stream and return an error if there was a multi-byte UTF-8 character whose bytes were split across two reads. It now handles this correctly.
- In JRuby only, the client returned an error when trying to reconnect a stream if the initial reconnect delay was set to zero.
- As per the specification, the parser now ignores any
id:
field whose value contains a null (zero byte). - The last event ID that is sent in the
Last-Event-Id
header was only being updated if an event specified a non-empty value forid:
. As per the specification, it should be possible to explicitly clear this value by putting an emptyid:
field in an event.
2.1.1
[2.1.1] - 2021-10-12
Fixed:
- Performance should now be greatly improved when parsing events that have very long data. Previously, the logic for parsing the stream to find line breaks could result in unnecessary extra scans of the same characters and unnecessary extra string slicing. (#20)
- The backoff delay algorithm was being inappropriately applied before the first connection attempt. In the default configuration, that meant an extra delay of between 0.5 seconds and 1 second.
- Leading linefeeds were being dropped from multi-line event data. This does not affect use of
SSE::Client
within the LaunchDarkly SDK, because LaunchDarkly streams consist of JSON data so unescaped linefeeds are not significant, but it could affect uses of this library outside of the SDK.
2.1.0
2.0.1
[2.0.1] - 2021-08-10
Changed:
- The dependency version constraint for the
http
gem is now looser: it allows 5.x versions as well as 4.x. The breaking changes inhttp
v5.0.0 do not affectld-eventsource
. - The project's build now uses v2.2.10 of
bundler
due to known vulnerabilities in other versions. Gemfile.lock
has been removed from source control. As this is a library project, the lockfile never affected application code that used this gem, but only affected the gem's own CI build. It is preferable for the CI build to refer only to the gemspec so that it resolves dependencies the same way an application using this gem would, rather than using pinned dependencies that an application would not use.
2.0.0
[2.0.0] - 2021-01-26
Added:
- Added a
socket_factory
configuration option which can be used for socket creation by the HTTP client if provided. The value ofsocket_factory
must be an object providing anopen(uri, timeout)
method and returning a connected socket.
Changed:
- Switched to the
http
gem instead ofsocketry
and a custom HTTP client. - Dropped support for Ruby < version 2.5
- Dropped support for JRuby < version 9.2
1.0.3
[1.0.3] - 2020-03-17
Fixed:
- The backoff delay logic for reconnecting after a stream failure was broken so that if a failure occurred after a stream had been active for at least
reconnect_reset_interval
(default 60 seconds), retries would use no delay, potentially causing a flood of requests and a spike in CPU usage.
1.0.2
[1.0.2] - 2020-03-10
Removed:
- Removed an unused dependency on
rake
. There are no other changes in this release.
1.0.1
Fixed:
- Calling
close
on the client could cause a misleading warning message in the log, such asUnexpected error from event source: #<IOError: stream closed in another thread>
.