Remove memoization for CloudConnector interface

While investigating the issue: https://gitlab.com/gitlab-org/gitlab/-/issues/476506+ we discovered that the root cause for the issue can be an edge case where different server processes cache stale state when upgrading from a 16.x version of GitLab to 17.x version.

What was observed:

The result of the graphql query was randomly flickering between true and false

query getCodeSuggestionsSupport {
    currentUser {
      ide {
        codeSuggestionsEnabled
      }
    }
  }

This suggested that there is a problem with stale data on some customers puma workers.

We do use strong memorization for add_on_purchases.

The assumption is that:

  1. The customer upgraded to 17.2 and didn't have purchased the Duo Pro Add-On
  2. The customer runs several Puma workers for the Gitlab rails application
  3. Some Puma workers have memoized that there was no active add-on purchases
  4. The customer's instance runs SeatSync Link with the CustomersDot, creating the add-on purchase (and the customer was able to assign the seats)
  5. Some workers CloudConnector::AvailableServices.find_by_name(:code_suggestions).available_for(user) returned false, because add-on purchases returns memoized empty array.

We should reconsider the need and potentially remove the memoization for

Related to: https://gitlab.com/gitlab-org/gitlab/-/issues/476506+

Edited by Allison Browne