Skip to content

Sync: emit cancelled/rejected orders as failed when the gateway still holds them as pending (issue 0098) - #44

Merged
spbsoluble merged 4 commits into
fix/0097-sync-productid-namefrom
fix/0098-cancelled-orders-stay-pending
Nov 17, 2026
Merged

spbsoluble merged 4 commits into
fix/0097-sync-productid-namefrom
fix/0098-cancelled-orders-stay-pending

Conversation

@spbsoluble

@spbsoluble spbsoluble commented Nov 16, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Sync now marks a cancelled or rejected order as failed when the gateway still holds it as pending. Before, those orders stayed pending forever.

Fixes

  • The bug: sync skips cancelled and rejected orders, and the gateway only updates a row when sync sends it. An order the gateway already held as pending never got updated.

  • The fix: before skipping one of these orders, sync checks what the gateway holds for it:

    Gateway holds the order as Sync does
    pending sends it as failed, once
    no row skips it, so no rows are created for old cancelled orders
    failed or cancelled skips it
    issued or revoked skips it; a cancellation never downgrades a row with a certificate
    lookup not possible, or it errors skips it, as before
  • Scope: V1 and V2. The sync summary gains FailedPropagated, with one Information line per order. Each failed row costs one gateway DB lookup per pass.

Testing

  • Unit tests: 1350 passed, and 1265 with DcvSupport=false.
  • Release builds: 0 warnings in both configs.
  • New SyncTerminalFailurePropagationTests:
    • V2 and V1, each with all five gateway states in one pass.
    • Only the pending row is sent.
    • V2 makes no Track Order call.
    • A sync with no gateway reader skips these orders.

Other

spbsoluble and others added 2 commits November 16, 2026 14:23
… still holds it as pending

Both syncs skip orders cancelled or rejected at CERTInext, and the gateway changes a
row only when the sync emits a record for it, so an order it held as pending stayed
pending indefinitely (8 kfclab rows, all 'Order Cancelled | Rejected due to Order
Cancellation', Track: cancelled). Before skipping, the sync now asks the gateway
(ICertificateDataReader.GetStatusByRequestID): held as pending -> emit failed with no
certificate, once. No row (ArgumentException), already terminal, issued/revoked
(never downgraded), no reader, or a lookup error keep the skip. Summaries gain
FailedPropagated. Issue 0098.
@spbsoluble
spbsoluble added this pull request to stack #45 November 17, 2026 03:19
…ildcard CN

A DV/OV request with CN = apex and SAN = *.apex failed with EMS-1173: the
wrapper keys "wildcard" on certificate.domain alone and resolved a plain
UCC product. Sending the wildcard as the domain is rejected too (EMS-1056,
the domain must match the CSR CN). Both confirmed live.

With no template ProductCode, the plugin now reads the catalog and sends
the account's single active Wildcard UCC product (typeID 21 DV / 22 OV) as
X-Product-Code. No match, several matches, a catalog failure, or EV fails
before any order is placed, asking for ProductCode.

Adds unit coverage and an opt-in live probe (CERTINEXT_V2_WILDCARD_SAN_PROBE).
@spbsoluble
spbsoluble merged commit ceb2187 into release-2.0 Nov 17, 2026
@spbsoluble
spbsoluble deleted the fix/0098-cancelled-orders-stay-pending branch November 17, 2026 04:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant