-
Notifications
You must be signed in to change notification settings - Fork 9
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
Infinite validations #2
Comments
I am using pg, memcached, and rails 2.3.5. Would be nice if you could fix it (I don't know if it is db specific, because on postgresql every call gets wrapped in a transaction, but postgresql is definitely an important database). I hacked up a temporary solution that seems to work for now (but it is strictly temporary, a better fix would be nice): http://gist.github.com/371884#file_seesion.rb#validate_by_openid |
Interesting we're not seeing this on MySQL... |
What do you think about my solution? |
Could you fork of and commit your patch? It isn't really easy to read in a gist. Thank you. |
Sure: http://github.com/glebm/authlogic_openid/commit/cac94dca5dacadb40220e65505ae02691b152fe6 It is bit dirty, but then again I am not sure if it is the right way to do it. |
I made it threads-friendly, I think we can merge now :) |
The reason for the problems with PostgreSQL is that authlogic_openid relies on the records created inside of transaction being available in it. I.e.:
My fix is a hack that uses a thread-local variable to track the record. A definitely better solution would be passing down and getting back the records from various plugged in validations, but I am not experienced enough with authlogic to implement it. |
Thanks for looking into this. |
Hmm, I'll recheck then |
Oh, I see. In rails nested transactions are implemented with savepoints, so the issue might be there |
If auto_register is on here is what happens:
validate_by_openid calls auto_reg_record.save which calls Authlogic::Session::Cookies::InstanceMethods#persist_by_cookie which calls valid? which calls validate_by_openid, et cetera...
The text was updated successfully, but these errors were encountered: