You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Morph refreshes strip connected from turbo-cable-stream-source #792
TurboCableStreamSourceElement sets connected itself once its subscription is up (#430), so the server-rendered turbo_stream_from tag never includes it. When Turbo morphs the page (turbo_refreshes_with method: :morph), idiomorph syncs the element's attributes from the new HTML and removes connected. The subscription itself carries on fine, but the element now looks disconnected.
That trips Turbo::SystemTestHelper: connect_turbo_cable_stream_sources (run after visit by default) and the :turbo_cable_stream_source, connected: true selector both rely on [connected], so after any morph refresh they wait on, or fail for, a stream that's actually live.
To reproduce:
A page with turbo_refreshes_with method: :morph and turbo_stream_from @record.
Visit it and wait for turbo-cable-stream-source[connected].
Trigger @record.broadcast_refresh.
turbo-cable-stream-source[connected] is gone, even though later broadcasts still arrive.
A fix could be for the element to cancel turbo:before-morph-attribute for connected on itself. We're working around it in our app with a document-level listener that does the same:
Activity
seanpdoyle commentedon Oct 30, 2026
@lucidstack thank you for opening this issue. The solution that you've proposed sounds like a welcomed improvement. Please open a pull request.
lucidstack commentedon Nov 15, 2026
@seanpdoyle thank you! I've opened #795 with the fix on the element itself, plus a test that
connectedsurvives a morph refresh 🙇