TrestleAdmin / trestle

A modern, responsive admin framework for Ruby on Rails
https://trestle.io
GNU Lesser General Public License v3.0
1.97k stars 177 forks source link

Installing Trestle interferes with Turbo frame #518

Closed yangtheman closed 2 weeks ago

yangtheman commented 3 weeks ago

Hi there,

I noticed that on Rails 8.0.0.rc2, installing Trestle (0.10.1) somehow removes or blocks /cable route. Normally you would see something like this for a page that has turbo frame:

Started GET "/cable" for ::1 at 2024-10-31 14:34:29 -0700
Started GET "/cable" [WebSocket] for ::1 at 2024-10-31 14:34:29 -0700
Successfully upgraded to WebSocket (REQUEST_METHOD: GET, HTTP_CONNECTION: Upgrade, HTTP_UPGRADE: websocket)
Turbo::StreamsChannel is transmitting the subscription confirmation
Turbo::StreamsChannel is streaming from conversation

But with Trestle, you see the following and none of the turbo works.

ActionController::RoutingError (No route matches [GET] "/cable"):

Started GET "/cable" for ::1 at 2024-10-31 14:48:27 -0700

This is with nothing else changed except install Trestle and before running bin/rails generate trestle:install.

This is only thing that's preventing us from going forward and using Trestle. Any help would be much appreciated.

spohlenz commented 3 weeks ago

I have been able to reproduce this on Rails 8.0.0.rc2, though the issue doesn't appear to be present in Rails 7.2. I've narrowed it down to the call to Rails.application.reload_routes! within the Trestle reloader, and I believe is related to test failures I'm seeing with trestle-auth on Rails 8.0.

I will keep investigating further.

spohlenz commented 2 weeks ago

It looks like there is now a PR in place for rails code (rails/rails#53522) to fix this. I've tested the branch and it appears to fix this issue as well as the trestle-auth test failures with Rails 8.0.

I'll keep this issue open until it is fully merged in upstream but hopefully that will be the solution here.

spohlenz commented 2 weeks ago

Closing as the fix has now been merged into the Rails 8-0-stable branch.

yangtheman commented 2 weeks ago

@spohlenz Hey, I just want to thank you for being on top of the issue! I really appreciate it.