[go: up one dir, main page]

Skip to content

Update user counts on self-managed instances when a new license is applied

What does this MR do and why?

On self-managed instances, when a new license is applied, the user counts do not automatically update on the Admin Area subscription page (/admin/subscription):

Screenshot_2025-03-17_at_15.49.35

Some numbers can be partly updated manually (the circular icon by the Last sync value):

Screenshot_2025-03-17_at_15.51.30

However, for all these numbers to update, customers must wait until the worker (Analytics::UsageTrends::CountJobTriggerWorker) runs. We can improve the user experience by running the child worker of CountJobTriggerWorker - Analytics::UsageTrends::CounterJobWorker - as soon as a license is applied.

This MR adds a new after_commit method to the License model - update_billable_user_counts - which runs that worker on license creation.

References

Screenshots or screen recordings

Before applying license After applying license Notes
Screenshot_2025-03-17_at_15.19.24 Screenshot_2025-03-17_at_15.29.06 Before the change, the user counts did not register a new user being added. After the change, that number has correctly updated.

How to set up and validate locally

  1. Start GDK in self-managed mode, as well as CustomersDot.
  2. Create a new user on GDK.
  3. Log out, then log in as the admin users.
  4. Navigate to https://gdk.test:3443/admin/subscription and note the user counts.
  5. Create a new license on CustomersDot (Premium or Ultimate) and use the activation code to activate it on the same GDK subscription page.
  6. Wait for some minutes for the counts to update. All numbers should be correct and account for the new user.

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Merge request reports

Loading