Skip to content
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

Silence update sql log in session upgrade #181

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

biinari
Copy link

@biinari biinari commented Apr 7, 2021

When upgrading sessions using secure! directly or using the rake task
db:sessions:upgrade, it would log entries like:

  ActiveRecord::SessionStore::Session Load (3.1ms)  SELECT  "sessions".* FROM "s
essions" ORDER BY "sessions"."id" ASC LIMIT 1000
  ActiveRecord::SessionStore::Session Update (1.9ms)  UPDATE "sessions" SET "ses
sion_id" = '2::[some_session_id]'
 WHERE "sessions"."id" = 2

Silence logger for these operations to prevent logging session ids.

Prevent logging of the SQL UPDATE statement when upgrading an old session to
use the new session_id format
Prevent logging SQL statements in session id upgrade task db:sessions:upgrade

Reenable rake tasks in setup to allow them to run multiple times in separate
tests.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant