Skip to content

Conversation

@everettbu
Copy link
Contributor

Test 3

… many times each email address is blocked, and last time it was blocked. Move email validation out of User model and into EmailValidator. Signup form remembers which email addresses have failed and shows validation error on email field.
@lizard-boy
Copy link

cursor review

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bugbot free trial expires on August 11, 2025
Learn more in the Cursor dashboard.

record.save
end
record && record.action_type == actions[:block]
end
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Query Method Causes Unintended Database Writes

The BlockedEmail.should_block? method has unintended side effects, incrementing match_count and updating last_match_at in the database. This violates the principle that query methods should be read-only. As it's called during validation (e.g., by EmailValidator), which can execute multiple times per user action (e.g., form input, failed registration attempts), it leads to inflated and inaccurate match_count statistics.

Locations (1)
Fix in Cursor Fix in Web

@github-actions
Copy link

This pull request has been automatically marked as stale because it has been open for 60 days with no activity. To keep it open, remove the stale tag, push code, or add a comment. Otherwise, it will be closed in 14 days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants