hotwired / turbo-rails

Use Turbo in your Ruby on Rails app
https://turbo.hotwired.dev
MIT License
2.13k stars 329 forks source link

Raise ArgumentError when turbo_stream_from helper gets passed blank streamables #661

Closed mwallba closed 2 months ago

mwallba commented 3 months ago

Hi everyone,

When people pass in blank streamables into turbo_stream_from it can lead to unpredictable issues for i.e. the postgresql ActionCable adapter blowing up (postgresql's NOTIFY will throw an exception when passed in an empty string): https://github.com/reclaim-the-stack/actioncable-enhanced-postgresql-adapter/issues/3 (this issue does also happen with the regular postgresql adapter - I ran into it myself).

I'm not sure if it is a little too overzealous here to prevent any of the passed in streamables from being blank. But I can't come up with a scenario where one might pass in a blank string or nil in between other streamables intentionally.