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

Change dynamic captcha registration rates calculation #2684

Merged
merged 6 commits into from
Nov 6, 2024

Conversation

lmuntaner
Copy link
Collaborator

@lmuntaner lmuntaner commented Nov 5, 2024

Motivation

The dynamic captcha is triggered without user registration spikes.

This is due to the current calculation of the current rate which doesn't use the current interval, and instead uses as interval the difference between now and the oldest point.

For example:

  • current_rate_interval is 5 minutes.
  • There are no registrations in the last 5 minutes.
  • Then two new registrations are added in 2 seconds.
  • The calculation right afterwards will be 2 seconds. Therefore, the rate would be 2 registrations / 2 seconds -> 1. Instead of 2 registrations / 5 minutes.

Changes

  • Change the rate calculation in registration_rates.

Tests

  • Change the test expectations.

🟡 Some screens were changed

@lmuntaner lmuntaner force-pushed the lm-fix-dynamic-captcha-rate-calculation branch from 3090ec1 to 6ebb3af Compare November 5, 2024 13:15
@lmuntaner lmuntaner marked this pull request as ready for review November 6, 2024 12:10
@lmuntaner lmuntaner requested a review from a team as a code owner November 6, 2024 12:10
@lmuntaner lmuntaner requested a review from sea-snake November 6, 2024 12:10
@lmuntaner
Copy link
Collaborator Author

@sea-snake please review

@lmuntaner lmuntaner force-pushed the lm-fix-dynamic-captcha-rate-calculation branch from 52f06b4 to d543d0e Compare November 6, 2024 12:10
Copy link
Contributor

@sea-snake sea-snake left a comment

Choose a reason for hiding this comment

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

As discussed, this change will affect the behavior when window size configuration has changed since this change doesn't take into account how to handle missing (pruned) data points.

Overall, as long as we don't change the window size configuration till we have an implementation handling the missing data points, we shouldn't run into issues.

@lmuntaner lmuntaner added this pull request to the merge queue Nov 6, 2024
Merged via the queue into main with commit cfe7308 Nov 6, 2024
67 checks passed
@lmuntaner lmuntaner deleted the lm-fix-dynamic-captcha-rate-calculation branch November 6, 2024 14:55
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.

2 participants