Cloud License activation failure when future dated renewal and past subscription trueups
Bug
Summary
When activating a cloud license for the first time (especially when coming from legacy), the cloud license is generated using the subscription version that better "fits" the activation moment / date.
Per @vshumilo:
The subscription version is resolved here using this logic
Additional context
- This decision was per-design to allow a customer that is in the middle of a subscription term to upgrade to cloud license we decided to use the current subscription version (applicable at the moment of the activation)
- The specific logic on how this current subscription is resolved changed ~1 month ago, current one should be more accurate. Is this something you have seen reported in the last month or since the release of cloud activation?
However, in some cases when the following conditions are also true:
- A future-dated renewal amendment exists
- The current, pre-renewal version of the subscription has true-ups
The cloud license being generated is failing to activate until at least the start date of the renewal term when the license gets generated with the most recent version of the subscription.
It seems to be related to true-up checking (documented in at least 2 of the reported examples), and possibly current billable users since the trueup logic includes a fallback check on current users that would normally be skipped in cloud licenses.
Currently unknown why the true-up logic would be failing, even for the current (non-renewal) term; in theory it should be generating a license that works the same as it did at the start of the current term. It's using trueup_from
and trueup_to
of the current period, in other words, trueup_from == current_starts_at - 1 year
and trueup_to == current_starts_at
example ticket
example customer
example cloud license
Steps to reproduce
- Be on legacy license
- Have your current term subscription include true-ups
- Adjust user counts in a way that prevents your current license from being reactivated
- Either increase your billable users count, or your max historical (for current term)
- Try to convert to cloud license prior to renewal
Proposed fix
It's really the trueup logic at fault here, since that both re-validates current term trueups and also contains a current users check (which would be skipped without License#check_trueup
being called). Because these numbers can change over the course of a year, re-activating the current term license may be impossible.
Sidenote: Perhaps this highlights the discussions in this issue.
- Skip all of
License#check_users_limit
,License#check_trueup
, andLicense#check_restricted_user_count
when renewing or prior to renewing from legacy to cloud license the first time.
Workarounds
- Wait until start date of the renewal period
Reported examples
- https://gitlab.zendesk.com/agent/tickets/329201
- https://gitlab.zendesk.com/agent/tickets/325200
- https://gitlab.zendesk.com/agent/tickets/322732
- https://gitlab.zendesk.com/agent/tickets/324490
- https://gitlab.zendesk.com/agent/tickets/328920
- https://gitlab.zendesk.com/agent/tickets/340797
- https://gitlab.zendesk.com/agent/tickets/342180
- https://gitlab.zendesk.com/agent/tickets/342994 (result of manual legacy)
- https://gitlab.zendesk.com/agent/tickets/344686 (result of manual legacy)
- https://gitlab.zendesk.com/agent/tickets/360298 (result of manual legacy)
-
https://gitlab.zendesk.com/agent/tickets/375405 (current billable,
check_restricted_user_count
)