Skip to content

Fix sub-second timing comparison error for Devise confirmation period

Stan Hu requested to merge sh-fix-mysql-almost-there-spec-failure into master

On databases such as MySQL, it's possible to get into a timing comparison error if the value of Confirmable#confirmation_sent_at is within a second of 0.days.ago. This is possible mostly in specs that test this behavior and most likely not happening in practice. The result of this error causes a user to be deemed active when it should be inactive. To prevent this error, we explicitly check the configuration setting to be 0.days.ago.

Corresponding CE MR: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/11156

Closes #2362 (closed)

Merge request reports