-
-
Notifications
You must be signed in to change notification settings - Fork 174
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
StimulusReflex is not compatible with the standalone ActionCable server #666
Comments
@mckaygerhard this sounds like a different issue. Just for the record, would you mind sharing what you setup to make it work in your case? |
Hi @marcoroth thanks in advance i will detail only relevant steps and at the end i put a reference issue pretty similar but different in context (pdfjs gem) First using a vanilla project
In
In
After run Second try using a more complex project with stimulusAS i read seems stimulux reflex uses web socket so it depends of such request to After implementing stimulus reflex bla bla configure a root path (with default root set to "/" it works) change root_path as described in documentation: https://guides.rubyonrails.org/configuring.html#deploy-to-a-subdirectory-relative-url-root In
In
This seems do not work and action cable stimulus reflex just request always to my conclusions based on that:I concluded one of two things:
For reference @marcoroth check this similar bug at the pdfjs fixed issue: senny/pdfjs_viewer-rails#74 I am from rails 3 when redmine was started (now we have the great gitea/forgetto/gogs) and years later i found those several inflexible things.. |
Does anyone have a minimal reproducible example for the original issue? If the standalone server can access Redis, and it has some environment details on the |
i already make a reproducible kind of.. as example of that stimulus reflex still is not 100% honoring the RAILS configurations
this original bug implicit more than only access to resources.. as i explain, address resources are not accedible so its a clear bug.. you @Matt-Yorkley can help up making your own test of course.. just following comments |
Here's a Gist with an example setup to get StimulusReflex working with ActionCable running in Standalone mode (with Devise for authentication and Redis for session storage): https://gist.github.com/Matt-Yorkley/3a523be8597f20173ba91a872250e69d |
hi @Matt-Yorkley your cited example has |
You can use |
a meta tag? Do you mean that for stimulus/reflex is not enough to set because I do all the things that https://jlintusaari.net/deploying-rails-application-to-subdirectory/ mentions there, "tricks" needed to implements property that way... it is already explained in said article |
Bug Report
Describe the bug
Thanks to @javid-gulamaliyev, we were able to figure out that in the current version of StimulusReflex you can't use StimulusReflex and the Session Store if you are running ActionCable as a standalone server.
It fails to commit the session with:
The issue is this part:
stimulus_reflex/app/channels/stimulus_reflex/channel.rb
Line 100 in 52aa993
reflex.request.session
is just available in the web-server process and since this is executed in the context of the separate ActionCable server process it has no access to the session, which is also stated in the Rails docs.> The WebSocket server doesn't have access to the session, but it has access to the cookies. [...]
So I'm not sure if we can actually support the standalone ActionCable server with StimulusReflex, but either we could improve the
commit_session
method inchannel.rb
to check if we actually have access to the session and if not show a more helpful warning or trying to detect if ActionCable is running in the standalone mode so we can print a warning and warn the user early.To Reproduce
session_store
in your environmentExpected behavior
Either it should just work and start to commit to the session and don't show the error or it should catch the exception and warn the user that it might be caused by running the ActionCable server in standalone mode.
Versions
StimulusReflex
External tools
The text was updated successfully, but these errors were encountered: