From b6075dff52e2388cf6ff9bb4f0c1c64c8fe0d359 Mon Sep 17 00:00:00 2001 From: Conner Turnbull <133619638+cturnbull-bitwarden@users.noreply.github.com> Date: Thu, 5 Sep 2024 09:23:43 -0400 Subject: [PATCH] Commented out unreachable code (#4735) * Commented out unreachable code * Suppressed compiler warning "async method lacks await" --- .../Cloud/ValidateSponsorshipCommand.cs | 41 ++++++++++--------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/src/Core/OrganizationFeatures/OrganizationSponsorships/FamiliesForEnterprise/Cloud/ValidateSponsorshipCommand.cs b/src/Core/OrganizationFeatures/OrganizationSponsorships/FamiliesForEnterprise/Cloud/ValidateSponsorshipCommand.cs index 45fe77e1b..214786c0a 100644 --- a/src/Core/OrganizationFeatures/OrganizationSponsorships/FamiliesForEnterprise/Cloud/ValidateSponsorshipCommand.cs +++ b/src/Core/OrganizationFeatures/OrganizationSponsorships/FamiliesForEnterprise/Cloud/ValidateSponsorshipCommand.cs @@ -143,27 +143,28 @@ public class ValidateSponsorshipCommand : CancelSponsorshipCommand, IValidateSpo private async Task CancelSponsorshipAsync(Organization sponsoredOrganization, OrganizationSponsorship sponsorship = null) { - return; - if (sponsoredOrganization != null) - { - await _paymentService.RemoveOrganizationSponsorshipAsync(sponsoredOrganization, sponsorship); - await _organizationRepository.UpsertAsync(sponsoredOrganization); + await Task.CompletedTask; // this is intentional - try - { - if (sponsorship != null) - { - await _mailService.SendFamiliesForEnterpriseSponsorshipRevertingEmailAsync( - sponsoredOrganization.BillingEmailAddress(), - sponsorship.ValidUntil ?? DateTime.UtcNow.AddDays(15)); - } - } - catch (Exception e) - { - _logger.LogError(e, "Error sending Family sponsorship removed email."); - } - } - await base.DeleteSponsorshipAsync(sponsorship); + // if (sponsoredOrganization != null) + // { + // await _paymentService.RemoveOrganizationSponsorshipAsync(sponsoredOrganization, sponsorship); + // await _organizationRepository.UpsertAsync(sponsoredOrganization); + // + // try + // { + // if (sponsorship != null) + // { + // await _mailService.SendFamiliesForEnterpriseSponsorshipRevertingEmailAsync( + // sponsoredOrganization.BillingEmailAddress(), + // sponsorship.ValidUntil ?? DateTime.UtcNow.AddDays(15)); + // } + // } + // catch (Exception e) + // { + // _logger.LogError(e, "Error sending Family sponsorship removed email."); + // } + // } + // await base.DeleteSponsorshipAsync(sponsorship); } ///