Check if the Lead has been converted before updating it
If the user has requested previously a license and the lead has been converted, if he requests again a license when we update the Lead, it will throw an error.
https://sentry.gitlap.com/gitlab/customersgitlabcom/issues/180957/
Faraday::ClientError: CANNOT_UPDATE_CONVERTED_LEAD: cannot reference converted lead
app/services/create_salesforce_lead_service.rb:43:in `update_lead'
SalesforceClient.update!('Lead', params)
app/services/create_salesforce_lead_service.rb:32:in `create_or_update'
update_lead(params.merge(Id: existing_id))
app/services/create_salesforce_lead_service.rb:23:in `create_or_update_lead'
create_or_update(from_params)
app/services/create_salesforce_lead_service.rb:8:in `execute'
lead_id = create_or_update_lead
app/controllers/trials_controller.rb:39:in `create_salesforce_lead'
CreateSalesforceLeadService.new.execute(trial_user_params)
...
(104 additional frame(s) were not displayed)
Faraday::ClientError: CANNOT_UPDATE_CONVERTED_LEAD: cannot reference converted lead
Edited by Francisco Javier López (ex-Gitlab)