Skip to content

Commit cb47713

Browse files
authored
Fix stream_name calculation inside of thread (#727)
* Generate the stream name in the current thread * Whitespace * Revert to *streamables
1 parent 3db32e4 commit cb47713

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

app/channels/turbo/streams/broadcasts.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,10 @@ def broadcast_prepend_later_to(*streamables, **opts)
6868
end
6969

7070
def broadcast_refresh_later_to(*streamables, request_id: Turbo.current_request_id, **opts)
71+
stream_name = stream_name_from(streamables)
72+
7173
refresh_debouncer_for(*streamables, request_id: request_id).debounce do
72-
Turbo::Streams::BroadcastStreamJob.perform_later stream_name_from(streamables), content: turbo_stream_refresh_tag(request_id: request_id, **opts).to_str # Sidekiq requires job arguments to be valid JSON types, such as String
74+
Turbo::Streams::BroadcastStreamJob.perform_later stream_name, content: turbo_stream_refresh_tag(request_id: request_id, **opts).to_str # Sidekiq requires job arguments to be valid JSON types, such as String
7375
end
7476
end
7577

0 commit comments

Comments
 (0)