My rails 7 application is using turbo streams broadcast. But after running for a while it will start hanging/not loading anymore.
These are the last 3 lines from my application log
I, [2023-07-20T15:48:46.854914 #4211] INFO -- : [047924b6-20d4-4aca-90bb-cca4efcf99e0] Started GET "/cable" [WebSocket] for 93.117.245.115 at 2023-07-20 15:48:46 +0200
I, [2023-07-20T15:48:46.854984 #4211] INFO -- : [047924b6-20d4-4aca-90bb-cca4efcf99e0] Successfully upgraded to WebSocket (REQUEST_METHOD: GET, HTTP_CONNECTION: upgrade, HTTP_UPGRADE: websocket)
I, [2023-07-20T15:48:46.953230 #4211] INFO -- : Turbo::StreamsChannel is streaming from assign_employees_7
The pages are no longer loading and it stays on this line. New requests are not being received anymore.
My code is as follows:
In the controller after update
Turbo::StreamsChannel.broadcast_update_to("assign_employees_#{company.id}", target: "assign_employees_#{company.id}", partial: 'activities/assign_employees', locals: { activities: activities, calendars: company.calendars, shifts: shifts, company: company, group_id: session[:group_id] })
In my view
<%= turbo_stream_from "assign_employees_#{current_company.id}" %>
<%= render 'assign_employees', activities: @activities, calendar: @calendars, shifts: @shifts, company: current_company, group_id: session[:group_id] %>
I am really clueless as to what is going on. Server performance seems fine. I also get this when running the application locally for a while.