Saturday, August 9, 2025

Support for rack.response_finished callbacks in executor

Posted by zzak

Hi, it’s zzak. Let’s explore this week’s changes in the Rails codebase.

Add support for “rack.response_finished” callbacks in Action Dispatch’s Executor
The executor middleware now supports deferring completion callbacks to later in the request lifecycle by utilizing Rack’s rack.response_finished mechanism, when available. This enables applications to define callbacks that may rely on state that would be cleaned up by the executor’s completion callbacks.

Enable configuring Action View’s render tracker
You can opt-in to the new parser with config.action_view.render_tracker = :ruby or load_defaults(8.1). This new render tracking implementation was added in Rails 7.2, the RubyTracker.

Add credentials:fetch command
This new command allows fetching the value of a credential from the Kamal 2 credentials file.

$ bin/rails credentials:fetch kamal_registry/password

Make Logger freeze-friendly
Previously, you would get a FrozenError when trying to use a logger you called freeze on.

Stop trying to tidy bytes when escaping HTML
When using ERB::Util.html_escape we no longer try to handle invalid UTF-8 strings, since this is an issue for handling user-input, not escaping, we can optimize this method by not doing it.

You can view the whole list of changes here. We had 22 contributors to the Rails codebase this past week!

Until next time!

Subscribe to get these updates mailed to you.