Skip to content

Synchronize skips orders with no cert details yet instead of reporting their status #5

Description

@spbsoluble

Summary

GetCertificateInventoryAsync (Client/MarkMonitorClient.cs) skips any order whose cert field is null entirely during sync, instead of reporting it to Command with its current status:

if (certificateDetail.Cert == null)
{
    _logger.LogWarning(
        "Certificate {CertificateId} has no cert details yet (status {Status}) - skipping it for this sync rather than aborting the rest of the page",
        certificateDetail.Id, certificateDetail.Status);
    continue;
}

An order can sit in a cert-less state (e.g. very early CREATED/DIGI_NEEDS_CSR) for a while, or transition through one on its way to a terminal status. While it has no cert object yet, Synchronize never reports it to Command at all - so Command's own record for that request doesn't get updated until the order acquires a cert object, even though MarkMonitorCertificateStatusToCAStatus is perfectly capable of mapping the order's status field (e.g. CREATED, DIGI_FAILED, DIGI_REJECTED) without needing cert to be present.

Why it matters

Synchronize ignores lastSync/fullSync and always does a full re-pull of every order on every sync call (separate, known behavior), so in principle no status transition should ever be "missed" - but this skip means a record stuck in a cert-less state won't have its status refreshed in Command until MarkMonitor attaches a cert object, even if the order has already moved to a terminal status like failed/rejected that doesn't require one.

Suggested fix (not implemented here - filing only)

Report the order to certificatesBuffer using MarkMonitorCertificateStatusToCAStatus(certificateDetail) even when Cert == null, omitting only the cert-dependent fields (Certificate, CSR, RevocationDate) that genuinely aren't available yet.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions