Repository navigation
fix: Declare logger as a runtime dependency - #94
Merged
Merged
Conversation
jsonbailey
marked this pull request as ready for review
September 28, 2026 14:23
keelerm84
approved these changes
Sep 28, 2026
jsonbailey
pushed a commit
that referenced
this pull request
Sep 28, 2026
🤖 I have created a release *beep* *boop* --- ## [3.0.0](2.6.0...3.0.0) (2026-09-28) ### ⚠ BREAKING CHANGES * Report a server-initiated stream close to the error handler ([#91](#91)) ### Features * Report a server-initiated stream close to the error handler ([#91](#91)) ([7e4dc1b](7e4dc1b)) ### Bug Fixes * Declare logger as a runtime dependency ([#94](#94)) ([f7809c2](f7809c2)) * Stop the worker thread promptly when the client is closed during a reconnect wait ([#93](#93)) ([054b11b](054b11b)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Overview** > **Release 3.0.0** — bumps the package version from `2.6.0` to `3.0.0` in `.release-please-manifest.json`, `lib/ld-eventsource/version.rb`, and documents the release in `CHANGELOG.md`. > > This is a Release Please cut, not new library logic in the diff. The changelog records what ships in **3.0.0**: a **breaking** behavior change where a **server-initiated stream close** is reported through the client **error handler** (e.g. `StreamClosedByServerError`), plus fixes to declare **`logger` as a runtime dependency** and to **stop the worker thread promptly** when the client is closed during a reconnect backoff wait. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit d5431c5. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY --> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On Ruby 4.0,
require "ld-eventsource"fails with:This happens in any app that does not already pull in the
loggergem.Cause
lib/ld-eventsource/client.rbrequireslogger, but the gemspec listsloggeronly as a development dependency. Ruby 4.0 removedloggerfrom the default gems, so it is not available unless something declares it.Fix
Move
loggerfromadd_development_dependencytoadd_runtime_dependency. The constraint stays~> 1.5. Ruby 3.1 (the oldest supported version) shipslogger1.5.0, so this does not force an upgrade there.Proof
A Bundler project with only
gem "ld-eventsource", path: <this branch>, on Ruby 4.0.6, runningbundle exec ruby -e 'require "ld-eventsource"; puts :ok':cannot load such file -- logger (LoadError)ok(Bundler resolveslogger 1.7.0)Other requires checked
All
requirecalls inlib/. Standard-library ones arelogger,thread, anduri.threadis built in anduriis still a default gem in Ruby 4.0, so onlyloggerneeds a change. The code does not usebase64,ostruct,cgi,bigdecimal, orjsondirectly (JSON bodies go through thehttpgem).Tests
bundle exec rspec spec: 174 examples, 0 failuresbundle exec rubocop --parallel: 16 files inspected, no offensesCI covers Ruby 3.2, 3.3, 3.4, JRuby 9.4 and JRuby 10.0. It does not include Ruby 4.0.
Impact
The Ruby server SDK is not affected, because its lock file pulls in
loggerthrough other gems.Jira: SDK-3207
Note
Overview
Fixes
LoadErrorwhen requiringld-eventsourceon Ruby 4.0, whereloggeris no longer a default gem even thoughlib/ld-eventsource/client.rbrequires it.The gemspec now declares
logger(~> 1.5) as a runtime dependency instead of a development-only dependency, so Bundler installs it for consumers. The version constraint is unchanged and remains compatible with Ruby 3.1’s bundled logger.Reviewed by Cursor Bugbot for commit 3b046d5. Bugbot is set up for automated code reviews on this repo. Configure here.