ElMassimo / request_store_rails

📦 Per-request global storage for Rails prepared for multi-threaded apps
https://github.com/ElMassimo/request_store_rails
MIT License
85 stars 6 forks source link

Error 422 using devise and RequestStoreRails #7

Closed silva96 closed 6 years ago

silva96 commented 6 years ago

For some reason it fails, but using old https://github.com/steveklabnik/request_store it works.

compare_with_real_token(csrf_token, session) returns false instead of true.

trace:

actionpack (5.0.2) lib/action_controller/metal/request_forgery_protection.rb:195:in `handle_unverified_request'
actionpack (5.0.2) lib/action_controller/metal/request_forgery_protection.rb:223:in `handle_unverified_request'
devise (4.2.1) lib/devise/controllers/helpers.rb:253:in `handle_unverified_request'
actionpack (5.0.2) lib/action_controller/metal/request_forgery_protection.rb:218:in `verify_authenticity_token'
activesupport (5.0.2) lib/active_support/callbacks.rb:382:in `block in make_lambda'
activesupport (5.0.2) lib/active_support/callbacks.rb:169:in `block (2 levels) in halting'
actionpack (5.0.2) lib/abstract_controller/callbacks.rb:12:in `block (2 levels) in <module:Callbacks>'
activesupport (5.0.2) lib/active_support/callbacks.rb:170:in `block in halting'
activesupport (5.0.2) lib/active_support/callbacks.rb:454:in `block in call'
activesupport (5.0.2) lib/active_support/callbacks.rb:454:in `each'
activesupport (5.0.2) lib/active_support/callbacks.rb:454:in `call'
activesupport (5.0.2) lib/active_support/callbacks.rb:101:in `__run_callbacks__'
activesupport (5.0.2) lib/active_support/callbacks.rb:750:in `_run_process_action_callbacks'
activesupport (5.0.2) lib/active_support/callbacks.rb:90:in `run_callbacks'
actionpack (5.0.2) lib/abstract_controller/callbacks.rb:19:in `process_action'
actionpack (5.0.2) lib/action_controller/metal/rescue.rb:20:in `process_action'
actionpack (5.0.2) lib/action_controller/metal/instrumentation.rb:32:in `block in process_action'
activesupport (5.0.2) lib/active_support/notifications.rb:164:in `block in instrument'
activesupport (5.0.2) lib/active_support/notifications/instrumenter.rb:21:in `instrument'
activesupport (5.0.2) lib/active_support/notifications.rb:164:in `instrument'
actionpack (5.0.2) lib/action_controller/metal/instrumentation.rb:30:in `process_action'
actionpack (5.0.2) lib/action_controller/metal/params_wrapper.rb:248:in `process_action'
activerecord (5.0.2) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
actionpack (5.0.2) lib/abstract_controller/base.rb:126:in `process'
actionview (5.0.2) lib/action_view/rendering.rb:30:in `process'
actionpack (5.0.2) lib/action_controller/metal.rb:190:in `dispatch'
actionpack (5.0.2) lib/action_controller/metal.rb:262:in `dispatch'
actionpack (5.0.2) lib/action_dispatch/routing/route_set.rb:50:in `dispatch'
actionpack (5.0.2) lib/action_dispatch/routing/route_set.rb:32:in `serve'
actionpack (5.0.2) lib/action_dispatch/routing/mapper.rb:16:in `block in <class:Constraints>'
actionpack (5.0.2) lib/action_dispatch/routing/mapper.rb:46:in `serve'
actionpack (5.0.2) lib/action_dispatch/journey/router.rb:39:in `block in serve'
actionpack (5.0.2) lib/action_dispatch/journey/router.rb:26:in `each'
actionpack (5.0.2) lib/action_dispatch/journey/router.rb:26:in `serve'
actionpack (5.0.2) lib/action_dispatch/routing/route_set.rb:725:in `call'
newrelic_rpm (4.1.0.333) lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in `call'
omniauth (1.6.1) lib/omniauth/strategy.rb:189:in `call!'
omniauth (1.6.1) lib/omniauth/strategy.rb:167:in `call'
newrelic_rpm (4.1.0.333) lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in `call'
omniauth (1.6.1) lib/omniauth/strategy.rb:189:in `call!'
omniauth (1.6.1) lib/omniauth/strategy.rb:167:in `call'
newrelic_rpm (4.1.0.333) lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in `call'
omniauth (1.6.1) lib/omniauth/strategy.rb:189:in `call!'
omniauth (1.6.1) lib/omniauth/strategy.rb:167:in `call'
newrelic_rpm (4.1.0.333) lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in `call'
rack-pjax (1.0.0) lib/rack/pjax.rb:12:in `call'
newrelic_rpm (4.1.0.333) lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in `call'
/Users/benja/.rvm/gems/ruby-2.4.0@rails_5/bundler/gems/omnicontacts-5b5015ec2bb8/lib/omnicontacts/middleware/base_oauth.rb:43:in `call'
newrelic_rpm (4.1.0.333) lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in `call'
/Users/benja/.rvm/gems/ruby-2.4.0@rails_5/bundler/gems/omnicontacts-5b5015ec2bb8/lib/omnicontacts/builder.rb:28:in `call'
newrelic_rpm (4.1.0.333) lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in `call'
newrelic_rpm (4.1.0.333) lib/new_relic/rack/agent_hooks.rb:30:in `traced_call'
newrelic_rpm (4.1.0.333) lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in `call'
newrelic_rpm (4.1.0.333) lib/new_relic/rack/browser_monitoring.rb:32:in `traced_call'
newrelic_rpm (4.1.0.333) lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in `call'
remotipart (1.3.1) lib/remotipart/middleware.rb:32:in `call'
newrelic_rpm (4.1.0.333) lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in `call'
warden (1.2.7) lib/warden/manager.rb:36:in `block in call'
warden (1.2.7) lib/warden/manager.rb:35:in `catch'
warden (1.2.7) lib/warden/manager.rb:35:in `call'
newrelic_rpm (4.1.0.333) lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in `call'
rack (2.0.3) lib/rack/etag.rb:25:in `call'
newrelic_rpm (4.1.0.333) lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in `call'
rack (2.0.3) lib/rack/conditional_get.rb:38:in `call'
newrelic_rpm (4.1.0.333) lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in `call'
rack (2.0.3) lib/rack/head.rb:12:in `call'
newrelic_rpm (4.1.0.333) lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in `call'
rack (2.0.3) lib/rack/session/abstract/id.rb:232:in `context'
rack (2.0.3) lib/rack/session/abstract/id.rb:226:in `call'
newrelic_rpm (4.1.0.333) lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in `call'
actionpack (5.0.2) lib/action_dispatch/middleware/cookies.rb:613:in `call'
newrelic_rpm (4.1.0.333) lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in `call'
activerecord (5.0.2) lib/active_record/migration.rb:553:in `call'
newrelic_rpm (4.1.0.333) lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in `call'
actionpack (5.0.2) lib/action_dispatch/middleware/callbacks.rb:38:in `block in call'
activesupport (5.0.2) lib/active_support/callbacks.rb:97:in `__run_callbacks__'
activesupport (5.0.2) lib/active_support/callbacks.rb:750:in `_run_call_callbacks'
activesupport (5.0.2) lib/active_support/callbacks.rb:90:in `run_callbacks'
actionpack (5.0.2) lib/action_dispatch/middleware/callbacks.rb:36:in `call'
newrelic_rpm (4.1.0.333) lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in `call'
actionpack (5.0.2) lib/action_dispatch/middleware/executor.rb:12:in `call'
newrelic_rpm (4.1.0.333) lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in `call'
actionpack (5.0.2) lib/action_dispatch/middleware/remote_ip.rb:79:in `call'
newrelic_rpm (4.1.0.333) lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in `call'
airbrake (6.0.0) lib/airbrake/rack/middleware.rb:52:in `call'
newrelic_rpm (4.1.0.333) lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in `call'
actionpack (5.0.2) lib/action_dispatch/middleware/debug_exceptions.rb:49:in `call'
newrelic_rpm (4.1.0.333) lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in `call'
actionpack (5.0.2) lib/action_dispatch/middleware/show_exceptions.rb:31:in `call'
newrelic_rpm (4.1.0.333) lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in `call'
chewy (0.9.0) lib/chewy/railtie.rb:17:in `block in call'
chewy (0.9.0) lib/chewy/strategy.rb:63:in `wrap'
chewy (0.9.0) lib/chewy.rb:187:in `strategy'
chewy (0.9.0) lib/chewy/railtie.rb:17:in `call'
newrelic_rpm (4.1.0.333) lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in `call'
railties (5.0.2) lib/rails/rack/logger.rb:36:in `call_app'
railties (5.0.2) lib/rails/rack/logger.rb:24:in `block in call'
activesupport (5.0.2) lib/active_support/tagged_logging.rb:69:in `block in tagged'
activesupport (5.0.2) lib/active_support/tagged_logging.rb:26:in `tagged'
activesupport (5.0.2) lib/active_support/tagged_logging.rb:69:in `tagged'
railties (5.0.2) lib/rails/rack/logger.rb:24:in `call'
newrelic_rpm (4.1.0.333) lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in `call'
sprockets-rails (3.2.0) lib/sprockets/rails/quiet_assets.rb:13:in `call'
newrelic_rpm (4.1.0.333) lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in `call'
request_store (1.3.2) lib/request_store/middleware.rb:9:in `call'
newrelic_rpm (4.1.0.333) lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in `call'
request_store_rails (1.0.3) lib/request_store_rails/middleware.rb:17:in `call'
newrelic_rpm (4.1.0.333) lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in `call'
actionpack (5.0.2) lib/action_dispatch/middleware/request_id.rb:24:in `call'
newrelic_rpm (4.1.0.333) lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in `call'
rack (2.0.3) lib/rack/method_override.rb:22:in `call'
newrelic_rpm (4.1.0.333) lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in `call'
rack (2.0.3) lib/rack/runtime.rb:22:in `call'
newrelic_rpm (4.1.0.333) lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in `call'
activesupport (5.0.2) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
newrelic_rpm (4.1.0.333) lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in `call'
actionpack (5.0.2) lib/action_dispatch/middleware/executor.rb:12:in `call'
newrelic_rpm (4.1.0.333) lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in `call'
actionpack (5.0.2) lib/action_dispatch/middleware/static.rb:136:in `call'
newrelic_rpm (4.1.0.333) lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in `call'
rack (2.0.3) lib/rack/sendfile.rb:111:in `call'
newrelic_rpm (4.1.0.333) lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in `call'
actionpack (5.0.2) lib/action_dispatch/middleware/debug_locks.rb:39:in `call'
newrelic_rpm (4.1.0.333) lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in `call'
railties (5.0.2) lib/rails/engine.rb:522:in `call'
newrelic_rpm (4.1.0.333) lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in `call'
puma (3.8.2) lib/puma/configuration.rb:224:in `call'
puma (3.8.2) lib/puma/server.rb:600:in `handle_request'
puma (3.8.2) lib/puma/server.rb:435:in `process_client'
puma (3.8.2) lib/puma/server.rb:299:in `block in run'
puma (3.8.2) lib/puma/thread_pool.rb:120:in `block in spawn_thread'
ElMassimo commented 6 years ago

Been using Devise along with this gem for years in production now and haven't run into this error.

Which of your dependencies rely on request_store?

silva96 commented 6 years ago

yes is weird because we use 2 Devise authenticable models, one works while the other doesn't

here is my gemfile.lock

GIT
  remote: https://github.com/elastic/elasticsearch-ruby
  revision: d97dd6a8f8829bc043ec79f68008993abf86d60f
  specs:
    elasticsearch (6.0.0.pre)
      elasticsearch-api (= 6.0.0.pre)
      elasticsearch-transport (= 6.0.0.pre)
    elasticsearch-api (6.0.0.pre)
      multi_json
    elasticsearch-transport (6.0.0.pre)
      faraday
      multi_json

GIT
  remote: https://github.com/lassebunk/dynamic_sitemaps
  revision: 37beeba143e8202218ee814056231b0e6974bafb
  branch: master
  specs:
    dynamic_sitemaps (2.0.0)

GIT
  remote: https://github.com/recorrido-cl/swagger-ui_rails
  revision: 7535bed446f35eb34983bbb82a7e9c39deb2c0d2
  specs:
    swagger-ui_rails (2.1.0)

GIT
  remote: https://github.com/recorrido/imagesLoaded-rails
  revision: abbdadb3e44b5301ec1822215caaf0ede8213af1
  specs:
    imagesLoaded_rails (4.0.0)
      railties (>= 3.1)

GIT
  remote: https://github.com/recorridoCL/moment_timezone-rails
  revision: c3f3d31f95d9a157dfb3d55223b82adf847cc0ca
  specs:
    moment_timezone-rails (0.5.13)
      momentjs-rails (~> 2.17.1)

GIT
  remote: https://github.com/recorridoCL/weather-icons-rails
  revision: df3655fff7c153f54b189e2f636e2d544dbebf4b
  specs:
    weather-icons-rails (1.3.2.0)
      railties (>= 3.2)
      sass (>= 3.2)

GIT
  remote: https://github.com/recorridoCL/webpay-gem
  revision: 4e1fc4a4f648c8b0384839f82fe1ca711e606e9e
  specs:
    libwebpay (2.0.0)
      nokogiri (~> 1.6, >= 1.6.7.2)
      savon (~> 2)

GIT
  remote: https://github.com/richhollis/swagger-docs
  revision: 372e05ce944860ea35ca3496564492ae1e502100
  specs:
    swagger-docs (0.2.9)
      activesupport (>= 3)
      rails (>= 3)

GIT
  remote: https://github.com/rolme/omnicontacts
  revision: 5b5015ec2bb80097503eadbd82edec4979e06372
  branch: master
  specs:
    omnicontacts (0.3.9)
      json
      rack

GIT
  remote: https://github.com/samdunne/omniauth-gplus
  revision: 57c5978b80fb1aff37048001988d784ccf629d60
  branch: master
  specs:
    omniauth-gplus (2.0.1)
      omniauth-oauth2 (~> 1.1)

GIT
  remote: https://github.com/seuros/capistrano-puma
  revision: 1d7cca2e431c23943ebcde19588169ed12025833
  specs:
    capistrano3-puma (3.1.0)
      capistrano (~> 3.7)
      capistrano-bundler
      puma (~> 3.4)

GIT
  remote: https://github.com/seuros/capistrano-sidekiq
  revision: 339c42e24f42d8d72173daae832b23504930f941
  specs:
    capistrano-sidekiq (0.10.0)
      capistrano
      sidekiq (>= 3.4)

PATH
  remote: vendor/offline_gems/bustable-master
  specs:
    bustable (1.0)
      nokogiri
      typhoeus

PATH
  remote: vendor/offline_gems/ventascan-master
  specs:
    ventascan (0.0.1)
      RocketAMF
      rails
      rest-client

GEM
  remote: https://rubygems.org/
  specs:
    RocketAMF (0.2.1)
    aasm (4.12.0)
      concurrent-ruby (~> 1.0)
    actioncable (5.0.2)
      actionpack (= 5.0.2)
      nio4r (>= 1.2, < 3.0)
      websocket-driver (~> 0.6.1)
    actionmailer (5.0.2)
      actionpack (= 5.0.2)
      actionview (= 5.0.2)
      activejob (= 5.0.2)
      mail (~> 2.5, >= 2.5.4)
      rails-dom-testing (~> 2.0)
    actionpack (5.0.2)
      actionview (= 5.0.2)
      activesupport (= 5.0.2)
      rack (~> 2.0)
      rack-test (~> 0.6.3)
      rails-dom-testing (~> 2.0)
      rails-html-sanitizer (~> 1.0, >= 1.0.2)
    actionview (5.0.2)
      activesupport (= 5.0.2)
      builder (~> 3.1)
      erubis (~> 2.7.0)
      rails-dom-testing (~> 2.0)
      rails-html-sanitizer (~> 1.0, >= 1.0.3)
    active_record_query_trace (1.5.4)
    activejob (5.0.2)
      activesupport (= 5.0.2)
      globalid (>= 0.3.6)
    activemerchant (1.64.0)
      activesupport (>= 3.2.14, < 5.1)
      builder (>= 2.1.2, < 4.0.0)
      i18n (>= 0.6.9)
      nokogiri (~> 1.4)
    activemodel (5.0.2)
      activesupport (= 5.0.2)
    activerecord (5.0.2)
      activemodel (= 5.0.2)
      activesupport (= 5.0.2)
      arel (~> 7.0)
    activesupport (5.0.2)
      concurrent-ruby (~> 1.0, >= 1.0.2)
      i18n (~> 0.7)
      minitest (~> 5.1)
      tzinfo (~> 1.1)
    addressable (2.5.1)
      public_suffix (~> 2.0, >= 2.0.2)
    airbrake (6.0.0)
      airbrake-ruby (~> 2.0)
    airbrake-ruby (2.0.0)
    airbrussh (1.2.0)
      sshkit (>= 1.6.1, != 1.7.0)
    akami (1.3.1)
      gyoku (>= 0.4.0)
      nokogiri
    amq-protocol (2.1.0)
    arel (7.1.4)
    ast (2.3.0)
    autoparse (0.3.3)
      addressable (>= 2.3.1)
      extlib (>= 0.9.15)
      multi_json (>= 1.0.0)
    autoprefixer-rails (6.7.7.2)
      execjs
    awesome_print (1.8.0)
    aws-sdk (2.9.10)
      aws-sdk-resources (= 2.9.10)
    aws-sdk-core (2.9.10)
      aws-sigv4 (~> 1.0)
      jmespath (~> 1.0)
    aws-sdk-resources (2.9.10)
      aws-sdk-core (= 2.9.10)
    aws-sdk-v1 (1.67.0)
      json (~> 1.4)
      nokogiri (~> 1)
    aws-sigv4 (1.0.0)
    axiom-types (0.1.1)
      descendants_tracker (~> 0.0.4)
      ice_nine (~> 0.11.0)
      thread_safe (~> 0.3, >= 0.3.1)
    backbone-on-rails (1.2.0.0)
      eco
      ejs
      jquery-rails
      railties
    backbone-paginator-rails (2.0.2)
    backgridjs-rails (0.3.5)
      rails (>= 3.2.11)
    barby (0.6.5)
    bcrypt (3.1.11)
    bootstrap-datepicker-rails (1.6.4.1)
      railties (>= 3.0)
    bootstrap-sass (3.3.7)
      autoprefixer-rails (>= 5.2.1)
      sass (>= 3.3.4)
    bootstrap-slider-rails (9.2.0)
      railties (>= 3.2, < 6.0)
    builder (3.2.3)
    bunny (2.6.5)
      amq-protocol (>= 2.1.0)
    byebug (9.0.6)
    cancancan (1.16.0)
    canonical-rails (0.1.2)
      rails (>= 4.1, < 5.1)
    capistrano (3.8.1)
      airbrussh (>= 1.0.0)
      i18n
      rake (>= 10.0.0)
      sshkit (>= 1.9.0)
    capistrano-bundler (1.2.0)
      capistrano (~> 3.1)
      sshkit (~> 1.2)
    capistrano-rails (1.2.3)
      capistrano (~> 3.1)
      capistrano-bundler (~> 1.1)
    capistrano-rvm (0.1.2)
      capistrano (~> 3.0)
      sshkit (~> 1.2)
    capybara (2.15.1)
      addressable
      mini_mime (>= 0.1.3)
      nokogiri (>= 1.3.3)
      rack (>= 1.0.0)
      rack-test (>= 0.5.4)
      xpath (~> 2.0)
    capybara-selenium (0.0.6)
      capybara
      selenium-webdriver
    chewy (0.9.0)
      activesupport (>= 3.2)
      elasticsearch (>= 1.0.0)
    childprocess (0.6.3)
      ffi (~> 1.0, >= 1.0.11)
    chosen-rails (1.5.2)
      coffee-rails (>= 3.2)
      railties (>= 3.0)
      sass-rails (>= 3.2)
    chronic (0.10.2)
    chunky_png (1.3.8)
    climate_control (0.1.0)
    cliver (0.3.2)
    cocaine (0.5.8)
      climate_control (>= 0.0.3, < 1.0)
    coderay (1.1.1)
    coercible (1.0.0)
      descendants_tracker (~> 0.0.1)
    coffee-rails (4.2.1)
      coffee-script (>= 2.2.0)
      railties (>= 4.0.0, < 5.2.x)
    coffee-script (2.4.1)
      coffee-script-source
      execjs
    coffee-script-source (1.12.2)
    colored (1.2)
    concurrent-ruby (1.0.5)
    connection_pool (2.2.1)
    countries (2.0.8)
      i18n_data (~> 0.7.0)
      money (~> 6.7)
      sixarm_ruby_unaccent (~> 1.1)
      unicode_utils (~> 1.4)
    country_select (3.0.0)
      countries (~> 2.0)
      sort_alphabetical (~> 1.0)
    crack (0.4.3)
      safe_yaml (~> 1.0.0)
    dalli (2.7.6)
    database_cleaner (1.5.3)
    descendants_tracker (0.0.4)
      thread_safe (~> 0.3, >= 0.3.1)
    devise (4.2.1)
      bcrypt (~> 3.0)
      orm_adapter (~> 0.1)
      railties (>= 4.1.0, < 5.1)
      responders
      warden (~> 1.2.3)
    devise_invitable (1.7.2)
      actionmailer (>= 4.1.0)
      devise (>= 4.0.0)
    diff-lcs (1.3)
    domain_name (0.5.20170404)
      unf (>= 0.0.5, < 1.0.0)
    doorkeeper (4.2.5)
      railties (>= 4.2)
    dotenv (2.2.0)
    dotenv-deployment (0.0.2)
    dotenv-rails (2.2.0)
      dotenv (= 2.2.0)
      railties (>= 3.2, < 5.1)
    easy_translate (0.5.0)
      json
      thread
      thread_safe
    eco (1.0.0)
      coffee-script
      eco-source
      execjs
    eco-source (1.1.0.rc.1)
    ejs (1.1.1)
    equalizer (0.0.11)
    erubis (2.7.0)
    ethon (0.10.1)
      ffi (>= 1.3.0)
    excon (0.55.0)
    execjs (2.7.0)
    extlib (0.9.16)
    factory_girl (4.8.0)
      activesupport (>= 3.0.0)
    factory_girl_rails (4.8.0)
      factory_girl (~> 4.8.0)
      railties (>= 3.0.0)
    fakeredis (0.6.0)
      redis (~> 3.2)
    fancybox2-rails (0.2.7)
      railties (>= 3.1.0)
    faraday (0.11.0)
      multipart-post (>= 1.2, < 3)
    faraday-cookie_jar (0.0.6)
      faraday (>= 0.7.4)
      http-cookie (~> 1.0.0)
    ffi (1.9.18)
    font-awesome-rails (4.7.0.1)
      railties (>= 3.2, < 5.1)
    formatador (0.2.5)
    geocoder (1.4.3)
    get_process_mem (0.2.1)
    globalid (0.4.0)
      activesupport (>= 4.2.0)
    gmaps4rails (2.1.2)
    google-api-client (0.8.6)
      activesupport (>= 3.2)
      addressable (~> 2.3)
      autoparse (~> 0.3)
      extlib (~> 0.9)
      faraday (~> 0.9)
      googleauth (~> 0.3)
      launchy (~> 2.4)
      multi_json (~> 1.10)
      retriable (~> 1.4)
      signet (~> 0.6)
    google-id-token (1.3.1)
      jwt
      multi_json
    google_drive (1.0.6)
      google-api-client (>= 0.7.0, < 0.9)
      nokogiri (>= 1.4.4, != 1.5.2, != 1.5.1)
      oauth (>= 0.3.6)
      oauth2 (>= 0.5.0)
    googleauth (0.5.1)
      faraday (~> 0.9)
      jwt (~> 1.4)
      logging (~> 2.0)
      memoist (~> 0.12)
      multi_json (~> 1.11)
      os (~> 0.9)
      signet (~> 0.7)
    gretel (3.0.9)
      rails (>= 3.1.0)
    guard (2.14.1)
      formatador (>= 0.2.4)
      listen (>= 2.7, < 4.0)
      lumberjack (~> 1.0)
      nenv (~> 0.1)
      notiffany (~> 0.0)
      pry (>= 0.9.12)
      shellany (~> 0.0)
      thor (>= 0.18.1)
    guard-compat (1.2.1)
    guard-rspec (4.7.3)
      guard (~> 2.1)
      guard-compat (~> 1.1)
      rspec (>= 2.99.0, < 4.0)
    guard-shell (0.7.1)
      guard (>= 2.0.0)
      guard-compat (~> 1.0)
    gyoku (1.3.1)
      builder (>= 2.1.2)
    haml (4.0.7)
      tilt
    hashdiff (0.3.2)
    hashie (3.5.5)
    high_voltage (3.0.0)
    highline (1.7.8)
    http-cookie (1.0.3)
      domain_name (~> 0.5)
    httpi (2.4.2)
      rack
      socksify
    i18n (0.8.1)
    i18n-js (3.0.0)
      i18n (~> 0.6, >= 0.6.6)
    i18n-tasks (0.9.13)
      activesupport (>= 4.0.2)
      ast (>= 2.1.0)
      easy_translate (>= 0.5.0)
      erubis
      highline (>= 1.7.3)
      i18n
      parser (>= 2.2.3.0)
      rainbow (~> 2.2)
      terminal-table (>= 1.5.1)
    i18n_data (0.7.0)
    ice_nine (0.11.2)
    inline_svg (1.2.0)
      activesupport (>= 3.0)
      nokogiri (>= 1.6)
    jbuilder (2.6.3)
      activesupport (>= 3.0.0, < 5.2)
      multi_json (~> 1.2)
    jmespath (1.3.1)
    jquery-countdown-rails (2.0.2)
    jquery-easing-rails (0.0.2)
      railties (>= 3.1.0)
    jquery-rails (4.3.1)
      rails-dom-testing (>= 1, < 3)
      railties (>= 4.2.0)
      thor (>= 0.14, < 2.0)
    jquery-ui-rails (5.0.5)
      railties (>= 3.2.16)
    jquery-validation-rails (1.16.0)
    js_cookie_rails (2.1.4)
      railties (>= 3.1)
    json (1.8.6)
    json-schema (2.8.0)
      addressable (>= 2.4)
    jwt (1.5.6)
    kaminari (0.17.0)
      actionpack (>= 3.0.0)
      activesupport (>= 3.0.0)
    launchy (2.4.3)
      addressable (~> 2.3)
    listen (3.1.5)
      rb-fsevent (~> 0.9, >= 0.9.4)
      rb-inotify (~> 0.9, >= 0.9.7)
      ruby_dep (~> 1.2)
    little-plugger (1.1.4)
    logging (2.2.2)
      little-plugger (~> 1.1)
      multi_json (~> 1.10)
    loofah (2.0.3)
      nokogiri (>= 1.5.9)
    lumberjack (1.0.11)
    mail (2.6.4)
      mime-types (>= 1.16, < 4)
    marionette-rails (2.4.4)
      railties (>= 3.1)
    mechanize (2.7.5)
      domain_name (~> 0.5, >= 0.5.1)
      http-cookie (~> 1.0)
      mime-types (>= 1.17.2)
      net-http-digest_auth (~> 1.1, >= 1.1.1)
      net-http-persistent (~> 2.5, >= 2.5.2)
      nokogiri (~> 1.6)
      ntlm-http (~> 0.1, >= 0.1.1)
      webrobots (>= 0.0.9, < 0.2)
    memoist (0.15.0)
    meta-tags (2.4.0)
      actionpack (>= 3.2.0, <= 5.1.0)
    method_source (0.8.2)
    mime-types (3.1)
      mime-types-data (~> 3.2015)
    mime-types-data (3.2016.0521)
    mimemagic (0.3.2)
    mini_mime (0.1.3)
    mini_portile2 (2.2.0)
    minitest (5.10.1)
    modernizr-rails (2.7.1)
    momentjs-rails (2.17.1)
      railties (>= 3.1)
    monetize (1.6.0)
      money (~> 6.8)
    money (6.9.0)
      i18n (>= 0.6.4, < 0.9)
    money-open-exchange-rates (0.7.0)
      monetize (~> 1.4)
      money (~> 6.7)
    multi_json (1.12.1)
    multi_xml (0.6.0)
    multipart-post (2.0.0)
    nenv (0.3.0)
    nested_form (0.3.2)
    net-http-digest_auth (1.4.1)
    net-http-persistent (2.9.4)
    net-scp (1.2.1)
      net-ssh (>= 2.6.5)
    net-ssh (4.1.0)
    netrc (0.11.0)
    newrelic_rpm (4.1.0.333)
    nio4r (2.0.0)
    nokogiri (1.8.0)
      mini_portile2 (~> 2.2.0)
    nori (2.6.0)
    notiffany (0.1.1)
      nenv (~> 0.1)
      shellany (~> 0.0)
    ntlm-http (0.1.1)
    oauth (0.5.1)
    oauth2 (1.3.1)
      faraday (>= 0.8, < 0.12)
      jwt (~> 1.0)
      multi_json (~> 1.3)
      multi_xml (~> 0.5)
      rack (>= 1.2, < 3)
    oily_png (1.2.1)
      chunky_png (~> 1.3.7)
    omniauth (1.6.1)
      hashie (>= 3.4.6, < 3.6.0)
      rack (>= 1.6.2, < 3)
    omniauth-facebook (4.0.0)
      omniauth-oauth2 (~> 1.2)
    omniauth-oauth (1.1.0)
      oauth
      omniauth (~> 1.0)
    omniauth-oauth2 (1.4.0)
      oauth2 (~> 1.0)
      omniauth (~> 1.2)
    omniauth-twitter (1.4.0)
      omniauth-oauth (~> 1.1)
      rack
    open-weather (0.12.0)
      json (~> 1)
    options (2.3.2)
    orm_adapter (0.5.0)
    os (0.9.6)
    owlcarousel-rails (1.1.3.3)
      jquery-rails
    paperclip (5.1.0)
      activemodel (>= 4.2.0)
      activesupport (>= 4.2.0)
      cocaine (~> 0.5.5)
      mime-types
      mimemagic (~> 0.3.0)
    paranoia (2.3.0)
      activerecord (>= 4.0, < 5.1)
    parser (2.4.0.0)
      ast (~> 2.2)
    paypal-sdk-rest (1.6.0)
      multi_json (~> 1.0)
      xml-simple
    pdf417 (1.0.0)
    pg (0.20.0)
    phantomjs.rb (2.1.0)
    pickadate-rails (3.5.6.0)
      railties (>= 3.1.0)
    poltergeist (1.14.0)
      capybara (~> 2.1)
      cliver (~> 0.3.1)
      websocket-driver (>= 0.2.0)
    progress_bar (1.1.0)
      highline (~> 1.6)
      options (~> 2.3.0)
    pry (0.10.4)
      coderay (~> 1.1.0)
      method_source (~> 0.8.1)
      slop (~> 3.4)
    public_suffix (2.0.5)
    puma (3.8.2)
    puma_worker_killer (0.1.0)
      get_process_mem (~> 0.2)
      puma (>= 2.7, < 4)
    rack (2.0.3)
    rack-pjax (1.0.0)
      nokogiri (~> 1.5)
      rack (>= 1.1)
    rack-protection (1.5.3)
      rack
    rack-test (0.6.3)
      rack (>= 1.0)
    railroady (1.5.2)
    rails (5.0.2)
      actioncable (= 5.0.2)
      actionmailer (= 5.0.2)
      actionpack (= 5.0.2)
      actionview (= 5.0.2)
      activejob (= 5.0.2)
      activemodel (= 5.0.2)
      activerecord (= 5.0.2)
      activesupport (= 5.0.2)
      bundler (>= 1.3.0, < 2.0)
      railties (= 5.0.2)
      sprockets-rails (>= 2.0.0)
    rails-controller-testing (1.0.1)
      actionpack (~> 5.x)
      actionview (~> 5.x)
      activesupport (~> 5.x)
    rails-dom-testing (2.0.2)
      activesupport (>= 4.2.0, < 6.0)
      nokogiri (~> 1.6)
    rails-html-sanitizer (1.0.3)
      loofah (~> 2.0)
    rails-i18n (5.0.3)
      i18n (~> 0.7)
      railties (~> 5.0)
    rails_12factor (0.0.3)
      rails_serve_static_assets
      rails_stdout_logging
    rails_admin (1.1.1)
      builder (~> 3.1)
      coffee-rails (~> 4.0)
      font-awesome-rails (>= 3.0, < 5)
      haml (~> 4.0)
      jquery-rails (>= 3.0, < 5)
      jquery-ui-rails (~> 5.0)
      kaminari (~> 0.14)
      nested_form (~> 0.3)
      rack-pjax (>= 0.7)
      rails (>= 4.0, < 6)
      remotipart (~> 1.3)
      sass-rails (>= 4.0, < 6)
    rails_email_preview (2.0.2)
      rails (>= 4.2)
      request_store
      sass-rails
      turbolinks
    rails_layout (1.0.34)
    rails_serve_static_assets (0.0.5)
    rails_stdout_logging (0.0.5)
    railties (5.0.2)
      actionpack (= 5.0.2)
      activesupport (= 5.0.2)
      method_source
      rake (>= 0.8.7)
      thor (>= 0.18.1, < 2.0)
    rainbow (2.2.2)
      rake
    rake (12.0.0)
    rb-fsevent (0.9.8)
    rb-inotify (0.9.8)
      ffi (>= 0.5.0)
    rdoc (4.3.0)
    recaptcha (4.1.0)
      json
    redis (3.3.3)
    redis-namespace (1.5.3)
      redis (~> 3.0, >= 3.0.4)
    remotipart (1.3.1)
    request_store (1.3.2)
    request_store_rails (1.0.3)
      concurrent-ruby (~> 1.0)
    responders (2.3.0)
      railties (>= 4.2.0, < 5.1)
    rest-client (2.0.1)
      http-cookie (>= 1.0.2, < 2.0)
      mime-types (>= 1.16, < 4.0)
      netrc (~> 0.8)
    retriable (1.4.1)
    rspec (3.5.0)
      rspec-core (~> 3.5.0)
      rspec-expectations (~> 3.5.0)
      rspec-mocks (~> 3.5.0)
    rspec-core (3.5.4)
      rspec-support (~> 3.5.0)
    rspec-expectations (3.5.0)
      diff-lcs (>= 1.2.0, < 2.0)
      rspec-support (~> 3.5.0)
    rspec-mocks (3.5.0)
      diff-lcs (>= 1.2.0, < 2.0)
      rspec-support (~> 3.5.0)
    rspec-rails (3.5.2)
      actionpack (>= 3.0)
      activesupport (>= 3.0)
      railties (>= 3.0)
      rspec-core (~> 3.5.0)
      rspec-expectations (~> 3.5.0)
      rspec-mocks (~> 3.5.0)
      rspec-support (~> 3.5.0)
    rspec-support (3.5.0)
    rubyXL (3.3.23)
      nokogiri (>= 1.4.4)
      rubyzip (>= 1.1.6)
    ruby_dep (1.5.0)
    rubyfish (0.0.6)
    rubyzip (1.2.1)
    rut_chileno (0.5)
    safe_yaml (1.0.4)
    sass (3.4.23)
    sass-rails (5.0.6)
      railties (>= 4.0.0, < 6)
      sass (~> 3.1)
      sprockets (>= 2.8, < 4.0)
      sprockets-rails (>= 2.0, < 4.0)
      tilt (>= 1.1, < 3)
    savon (2.11.1)
      akami (~> 1.2)
      builder (>= 2.1.2)
      gyoku (~> 1.2)
      httpi (~> 2.3)
      nokogiri (>= 1.4.0)
      nori (~> 2.4)
      wasabi (~> 3.4)
    sdoc (0.4.2)
      json (~> 1.7, >= 1.7.7)
      rdoc (~> 4.0)
    seed_dump (3.2.4)
      activerecord (>= 4)
      activesupport (>= 4)
    selectize-rails (0.12.4)
    selenium-webdriver (3.4.0)
      childprocess (~> 0.5)
      rubyzip (~> 1.0)
      websocket (~> 1.0)
    shellany (0.0.1)
    sidekiq (5.0.0.beta2)
      concurrent-ruby (~> 1.0)
      connection_pool (~> 2.2, >= 2.2.0)
      rack-protection (>= 1.5.0)
      redis (~> 3.2, >= 3.2.1)
    sidekiq-status (0.6.0)
      sidekiq (>= 2.7)
    sidekiq-superworker (1.0.0)
      activemodel (>= 3.2)
      activesupport (>= 3.2)
      sidekiq (>= 2.1.0)
    signer (1.5.0)
      nokogiri (>= 1.5.1)
    signet (0.7.3)
      addressable (~> 2.3)
      faraday (~> 0.9)
      jwt (~> 1.5)
      multi_json (~> 1.10)
    simple_form (3.4.0)
      actionpack (> 4, < 5.1)
      activemodel (> 4, < 5.1)
    sixarm_ruby_unaccent (1.1.1)
    slop (3.6.0)
    socksify (1.7.1)
    sort_alphabetical (1.1.0)
      unicode_utils (>= 1.2.2)
    sprockets (3.7.1)
      concurrent-ruby (~> 1.0)
      rack (> 1, < 3)
    sprockets-rails (3.2.0)
      actionpack (>= 4.0)
      activesupport (>= 4.0)
      sprockets (>= 3.0.0)
    sshkit (1.13.1)
      net-scp (>= 1.1.2)
      net-ssh (>= 2.8.0)
    tbk (1.0.3)
    terminal-notifier-guard (1.7.0)
    terminal-table (1.7.3)
      unicode-display_width (~> 1.1.1)
    thor (0.19.4)
    thread (0.2.2)
    thread_safe (0.3.6)
    tilt (2.0.7)
    time_diff (0.3.0)
      activesupport
      i18n
    timecop (0.8.1)
    turbolinks (5.0.1)
      turbolinks-source (~> 5)
    turbolinks-source (5.0.0)
    typhoeus (1.1.2)
      ethon (>= 0.9.0)
    tzinfo (1.2.3)
      thread_safe (~> 0.1)
    uglifier (3.2.0)
      execjs (>= 0.3.0, < 3)
    unf (0.1.4)
      unf_ext
    unf_ext (0.0.7.4)
    unicode-display_width (1.1.3)
    unicode_utils (1.4.0)
    validates_overlap (0.8.2)
      rails (>= 3.0.0)
    vcr (3.0.3)
    virtus (1.0.5)
      axiom-types (~> 0.1)
      coercible (~> 1.0)
      descendants_tracker (~> 0.0, >= 0.0.3)
      equalizer (~> 0.0, >= 0.0.9)
    warden (1.2.7)
      rack (>= 1.0)
    wasabi (3.5.0)
      httpi (~> 2.0)
      nokogiri (>= 1.4.2)
    webmock (3.0.1)
      addressable (>= 2.3.6)
      crack (>= 0.3.2)
      hashdiff
    webrobots (0.1.2)
    websocket (1.2.4)
    websocket-driver (0.6.5)
      websocket-extensions (>= 0.1.0)
    websocket-extensions (0.1.2)
    whenever (0.9.7)
      chronic (>= 0.6.3)
    wicked_pdf (1.1.0)
    will_paginate (3.1.5)
    will_paginate-bootstrap (1.0.1)
      will_paginate (>= 3.0.3)
    wkhtmltopdf-binary (0.9.9.3)
    xml-simple (1.1.5)
    xpath (2.1.0)
      nokogiri (~> 1.3)
    zeroclipboard-rails (0.1.2)
      railties (>= 3.1)

PLATFORMS
  ruby

DEPENDENCIES
  aasm
  active_record_query_trace
  activemerchant
  airbrake
  awesome_print
  aws-sdk
  aws-sdk-v1
  backbone-on-rails
  backbone-paginator-rails
  backgridjs-rails
  barby
  bootstrap-datepicker-rails
  bootstrap-sass
  bootstrap-slider-rails
  bunny
  bustable!
  byebug
  cancancan
  canonical-rails
  capistrano
  capistrano-rails
  capistrano-rvm
  capistrano-sidekiq!
  capistrano3-puma!
  capybara
  capybara-selenium
  chewy
  chosen-rails
  chunky_png
  coffee-rails
  colored
  country_select
  dalli
  database_cleaner
  devise
  devise_invitable
  doorkeeper
  dotenv-deployment
  dotenv-rails
  dynamic_sitemaps!
  elasticsearch!
  excon
  factory_girl_rails
  fakeredis
  fancybox2-rails
  faraday
  faraday-cookie_jar
  font-awesome-rails
  geocoder
  gmaps4rails
  google-api-client (< 0.9)
  google-id-token
  google_drive
  gretel
  guard
  guard-rspec
  guard-shell
  high_voltage
  i18n-js (>= 3.0.0.rc14)
  i18n-tasks
  imagesLoaded_rails!
  inline_svg
  jbuilder
  jquery-countdown-rails
  jquery-easing-rails
  jquery-rails
  jquery-validation-rails
  js_cookie_rails
  json-schema
  launchy
  libwebpay!
  marionette-rails
  mechanize
  meta-tags
  modernizr-rails
  moment_timezone-rails!
  momentjs-rails
  money-open-exchange-rates
  newrelic_rpm
  nokogiri
  oily_png
  omniauth
  omniauth-facebook
  omniauth-gplus!
  omniauth-twitter
  omnicontacts!
  open-weather
  owlcarousel-rails
  paperclip
  paranoia
  paypal-sdk-rest
  pdf417
  pg
  phantomjs.rb
  pickadate-rails
  poltergeist
  progress_bar
  puma
  puma_worker_killer
  railroady
  rails (~> 5.0.1, >= 5.0.0.1)
  rails-controller-testing
  rails-i18n
  rails_12factor
  rails_admin
  rails_email_preview
  rails_layout
  recaptcha
  redis
  redis-namespace
  request_store_rails
  rspec-rails
  rubyXL
  rubyfish
  rut_chileno
  sass-rails
  savon
  sdoc
  seed_dump
  selectize-rails
  selenium-webdriver
  sidekiq (= 5.0.0.beta2)
  sidekiq-status
  sidekiq-superworker (~> 1.0.0)
  signer
  simple_form
  swagger-docs!
  swagger-ui_rails!
  tbk
  terminal-notifier-guard
  time_diff
  timecop
  uglifier
  validates_overlap
  vcr
  ventascan!
  virtus
  weather-icons-rails!
  webmock
  whenever
  wicked_pdf
  will_paginate
  will_paginate-bootstrap
  wkhtmltopdf-binary (~> 0.9.9)
  zeroclipboard-rails

RUBY VERSION
   ruby 2.4.0p0

BUNDLED WITH
   1.15.4
silva96 commented 6 years ago

the only dependency using the old gem is rails_email_preview

should I do this?

Replacing request_store

While the plan is not to achieve 100% compatibility, this gem usually works well as a drop-in replacement. If you are using gems that rely on RequestStore but for some reason you need them to use the appropriate request/thread scope, you can try something like this on application.rb or similar:3

if RequestStore != RequestLocals
  RequestStore::Railtie.initializers.clear
  Kernel.suppress_warnings { RequestStore = RequestLocals }
end
ElMassimo commented 6 years ago

You could try doing that, but if it's just rails_email_preview which is used in development only, I'd recommend moving that and the request_store gem to the :development group in the Gemfile, and avoid using RequestStore or RequestLocals.

This gem was created to patch problems with other dependencies we have that use request_store, but if you have no such dependency, avoiding global storage is a good strategy.

That said, it's strange that it works for one of your models, yet doesn't work for another. Does your business logic rely on RequestLocals?

silva96 commented 6 years ago

Does your business logic rely on RequestLocals?

I set the current logged agency (would return nil if not logged in)

class ApplicationController < ActionController::Base

  before_action :authenticate, :set_request_locals

...

  def set_request_locals
    RequestLocals.store[:request] = request
    RequestLocals.store[:current_agency] = current_agency
  end

I commented the RequestLocals.store[:current_agency] = current_agency and it works, why it generates problem with the login?

Because I can use this stored value for other purposes in other requests, this login form in agency controller is giving problems.

silva96 commented 6 years ago

ended up doing a dirty fix for now (this is urgent in production)

RequestLocals.store[:current_agency] = current_agency unless params[:controller] == 'agencies/sessions'