From b13bd30cdcf8c575c3411cc6a15d00074f929a11 Mon Sep 17 00:00:00 2001 From: Pichatorn-A4K Date: Thu, 10 Sep 2026 21:18:32 +0700 Subject: [PATCH] Fix incremental sync discarding every certificate it retrieves The guard in the incremental (non-full) branch of Synchronize() reads if (orderCerts == null || orderCerts.Count > 0) { continue; } so it continues for every order whose certificates were retrieved successfully, and the blockingBuffer.Add loop below it is reachable only when the list is empty - in which case it iterates nothing. An incremental synchronization therefore adds zero certificates to the buffer unconditionally, while still logging 'Sync complete with 0 certificates' and returning normally, so it is indistinguishable from a healthy run with nothing to do. The full-sync branch a few lines above has the correct 'Count == 0'. Both guards were introduced in the same commit (ac791a75, 'Port sync CA filter from DCOM gateway'), which suggests a copy-paste with one edit missed rather than intent. Note that the incremental-window fixes in #38, #40 and #41 all operate inside this code path, which cannot emit anything until this predicate is corrected. --- digicert-certcentral-caplugin/CertCentralCAPlugin.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/digicert-certcentral-caplugin/CertCentralCAPlugin.cs b/digicert-certcentral-caplugin/CertCentralCAPlugin.cs index 176c2bd..f55e772 100644 --- a/digicert-certcentral-caplugin/CertCentralCAPlugin.cs +++ b/digicert-certcentral-caplugin/CertCentralCAPlugin.cs @@ -969,7 +969,7 @@ public async Task Synchronize(BlockingCollection blockin cancelToken.ThrowIfCancellationRequested(); string caReqId = order.order_id + "-" + order.certificate_id; orderCerts = GetAllConnectorCertsForOrder(caReqId, caList, divFilters, productFilters); - if (orderCerts == null || orderCerts.Count > 0) + if (orderCerts == null || orderCerts.Count == 0) { continue; }