Giter VIP home page Giter VIP logo

Comments (4)

mshibuya avatar mshibuya commented on August 10, 2024 1

@tubbo Thanks for the suggestion, I've updated the middleware check logic accordingly.

from redis-actionpack.

tubbo avatar tubbo commented on August 10, 2024

This seems due to the fact that ActionDispatch::Session::RedisStore is actually a subclass of Rack::Session::Redis, not ActionDispatch::Session::AbstractStore.

This line right here should return true because the middleware is indeed a session store which follows the entire API, but it's testing whether it's a direct subclass of the AbstractStore, which it is not, thus it fails.

The solution here is to extract the common functionality from Rack::Session::Redis into modules, allowing both Rack::Session::Redis and ActionDispatch::Session::AbstractStore to share the same functionality. I'll make an issue on redis-store/redis-rack that accompanies this one.

from redis-actionpack.

tubbo avatar tubbo commented on August 10, 2024

from redis-actionpack.

tubbo avatar tubbo commented on August 10, 2024

Looking at Dalli's implementation of Rack::Session, I believe the problem has more to do with how RailsAdmin is choosing to figure out which of the middleware is your session store. Instead of testing whether the middleware inherits from some base class, RailsAdmin could be looking for a middleware with the class name "ActionDispatch::Session::#{camelized_session_store_name_from_rails_config}", and then it wouldn't matter what the inheritance chain of that middleware was. Additionally, there's nothing preventing two session stores from being in the Rails middleware chain, technically, so this fix doesn't actually solve for all edge cases.

I don't think there's anything to be done in redis-actionpack, and instead the issue should be raised as to how rails-admin is testing for session store middleware in the chain. Gonna close this unless you feel otherwise.

from redis-actionpack.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.