-
Notifications
You must be signed in to change notification settings - Fork 48
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
Fix redis-rack for rack 2.0.8 #50
Conversation
This should fix this issue redis-store/redis-store#324 |
WIP, because still in rails app tests get session as string like this:
Maybe you @tubbo have ideas |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was not able to reproduce your use case. Here's what I did:
$ rails new testapp --no-rc
# wait for bundle to install
$ cd testapp
$ bundle add redis-rack sidekiq
I then changed config/routes.rb to the following:
require 'sidekiq/web'
Rails.application.routes.draw do
mount Sidekiq::Web, at: '/sidekiq', as: :sidekiq
end
And added an integration test into test/integration/sidekiq_integration_test.rb...
require 'test_helper'
class SidekiqIntegrationTest < ActionDispatch::IntegrationTest
test 'sidekiq' do
get sidekiq_path
assert_response :success
end
end
This test passed. I am not using a connection pool, and from the backtrace it looks like maybe you are?
@tubbo you need add devise in route:
It will fail after login in tests:
|
Ok, I found, that we also need this change, so it will work with new rack 2.0.8 and rails changes: redis-store/redis-actionpack#28 |
include Devise::Test::IntegrationHelpers
test 'sidekiq' do
user = users(:one)
login_as user, scope: user.class.name.underscore.to_sym
get sidekiq_path
assert_response :success
end require 'sidekiq/web'
Rails.application.routes.draw do
devise_for :users
authenticate :user do
mount Sidekiq::Web, at: '/sidekiq', as: :sidekiq
end
end update: since you found that the problem was in redis-actionpack, and i am not using redis-actionpack, that would make sense :) |
@tubbo rollback tests. Now I am not sure, how to deal with this changes, because it is clearly "broken changes" for redis-rack and redis-actionpack gems But I checked, both this changes for redis-rack and redis-actionpack works with new rails 6.0.2.1 and rack 2.0.8. So you should decide what to do next with all of this. |
@tubbo BTW, if you need any additional help for this changes in gems - just ping me (I am very interesting, that this gems will maintained) P.S. Looks like need release version, where redis-rack need rack >= 2.0.6 |
When will this be merged? |
@hasghari I am not repo owner or contributor, so I don't know ETA |
@hasghari @le0pard @johan-smits Hey folks, sorry for the delay...holidays and then getting back from holidays had me real busy. This all looks good to me! |
@gingerlime I was facing the same issue. You likely need to upgrade to |
Thanks @hasghari seems to do the trick 👍 |
@tubbo for me with both packages updated I get this error: |
@johan-smits read this comment rack/rack#1432 (comment) |
@le0pard thnx, missed that issue. Hoping it will be fixed in the next release I added: |
I still get this error
Routes: authenticate :user do
mount Sidekiq::Web, at: '/sidekiq'
end |
@Looooong can you paste the full backtrace? |
@tubbo Here is the backtrace:
|
This version need rack >= 2.0.8