pelargir / auto-session-timeout

Provides automatic session timeout in a Rails application.
MIT License
126 stars 63 forks source link

Rails 6 Zeitwerk Warning #27

Open aidandamerell opened 4 years ago

aidandamerell commented 4 years ago

DEPRECATION WARNING: Initialization autoloaded the constants ActionText::ContentHelper and ActionText::TagHelper.

Being able to do this is deprecated. Autoloading during initialization is going to be an error condition in future versions of Rails.

Reloading does not reboot the application, and therefore code executed during initialization does not run again. So, if you reload ActionText::ContentHelper, for example, the expected changes won't be reflected in that stale Module object.

These autoloaded constants have been unloaded.

Please, check the "Autoloading and Reloading Constants" guide for solutions. (called from <top (required)> at XXX

pelargir commented 4 years ago

Thanks for alerting me to this. I've been working on a new version of this gem that's compatible with Rails 6 and will incorporate this feedback into those changes.

moveson commented 3 years ago

I'm seeing this warning as well. Any progress on Rails 6 compatibility?

pelargir commented 3 years ago

@aidandamerell @moveson I'm curious where you both are seeing this. In the Rails log?

I'm running the gem on a freshly created Rails 6.1 project (with Devise) and I'm not seeing these warnings in the log, at least not in development mode. If you can provide more detail I'd like to help.

krsyoung commented 3 years ago

Hey, I seem to be in the same boat although my error only includes ActionText::ContentHelper.

This is a rails 6.0 app that is being bumped to 6.1.

Will keep poking around to see if I can figure out what is going on. Curious if @aidandamerell or @moveson made progress?

Cleaned backtrace:
        auto-session-timeout (0.9.7) lib/auto_session_timeout.rb:56:in `<main>'
        auto-session-timeout (0.9.7) lib/auto-session-timeout.rb:1:in `<main>'
        /app/config/application.rb:26:in `<main>'
        /app/rakefile:4:in `<main>'
        rake (13.0.3) lib/rake/rake_module.rb:29:in `load_rakefile'
        rake (13.0.3) lib/rake/application.rb:703:in `raw_load_rakefile'
        rake (13.0.3) lib/rake/application.rb:104:in `block in load_rakefile'
        rake (13.0.3) lib/rake/application.rb:186:in `standard_exception_handling'
        rake (13.0.3) lib/rake/application.rb:103:in `load_rakefile'
        rake (13.0.3) lib/rake/rake_module.rb:59:in `with_application'
        /app/bin/rails:10:in `<top (required)>'
        /app/bin/spring:15:in `require'
        /app/bin/spring:15:in `<top (required)>'
Most probably the cause is: auto-session-timeout (0.9.7) lib/auto_session_timeout.rb:56:in `<main>'

In a completely unscientific experiment the following seems to remove the error:

# lib/auto_session_timeout.rb:56
ActiveSupport.on_load(:action_controller) do
  ActionController::Base.send :include, AutoSessionTimeout
end
pelargir commented 1 year ago

Are you still getting this warning? It shouldn't be happening any longer.