code: protected function fixInvoiceDefault(CustomerAddressInterface $address)
      {
          if (!$this->persistenceHelper->isChanged($address, ['invoiceDefault'])) {
              return;
          }
  
          $customer = $address->getCustomer();
  
          if ($address->isInvoiceDefault()) {
              foreach ($customer->getAddresses() as $a) {
                  if ($a === $address) {
                      continue;
                  }
  
                  if ($a->isInvoiceDefault()) {
                      $a->setInvoiceDefault(false);
                      $this->persistenceHelper->persistAndRecompute($a, false);
                  }
              }
          } elseif (null === $customer->getDefaultInvoiceAddress(true)) {
              $address->setInvoiceDefault(true);
              $this->persistenceHelper->persistAndRecompute($address, false);
          }
      }
docs: Fixes the default invoice address.
  
  @param CustomerAddressInterface $address