Skip to content

Find the max limit for users count on free user cap

Doug Stull requested to merge 383264-fix-limit-calculation into master

What does this MR do and why?

  • finds the max limit to be used by the limit for the database queries.
  • We need to use this since we want to only run the full_users_count once per request, which we do. So we need to find the max limit setting from all of our possible dashboard_*limit settings so that our comparisons for notification and enforcement will always work as we expect.
    • before this change we'd only get back a max possible users_count that matched the first users_count query that was performed. That limit used in the first users_count could be Enforcement or Notification depending on feature flags or placement in the stack. This could cause scenarios where our comparison with users_count would yield false positives/negatives due to their individual definition of limit when comparing to users_count.
    • after this change we'll get back the max of those entries so that we'll always have true comparison results.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #383264

Edited by Doug Stull

Merge request reports