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 reloading in Ruby 3.3 #730

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Commits on Oct 1, 2024

  1. Fix reloading in Ruby 3.3

    This commit ensures the application is restarted when a preloaded file
    is changed. This has been silently broken because the fallback behavior
    still results in the application being restarted, but only when the user
    next runs a command—hence the acceptance test still passing.
    
    The behavior of `BasicSocket#recv` changed in Ruby 3.3 [1] such that it
    now returns `nil` on a closed stream socket, instead of an empty string.
    When we call `#empty?` on `nil` the `NoMethodError` is swallowed by the
    failsafe thread and the application is not restarted.
    
    This commit fixes the issue by checking both `#nil?` and `#empty?` so it
    works with both old and new versions. It also updates the acceptance
    test to be more specific about what it considers a "reload" by
    asserting the relevant log line exists.
    
    [1]: ruby/ruby#6407
    thomasmarshall committed Oct 1, 2024
    Configuration menu
    Copy the full SHA
    4105015 View commit details
    Browse the repository at this point in the history