75501f6a Changed Mailgun Logs ingestion to skip unreadable records and bound paging
ref https://linear.app/ghost/issue/BER-3936/raise-mailgun-event-fetch-throughput-concurrent-paging-logs-api
Review found several ways one provider response could stall every
analytics lane: a single record the adapter could not read threw and
reset the cursor on every cycle, a repeated pagination token did the
same, an empty page that still carried a token ended the domain and let
the cursor advance past unfetched events, and a page consisting only of
other sites' records did not count toward the per-domain budget, so a
low-volume site on a busy shared domain could page through the whole
account window serially.
Pages and records are now validated with Zod at the boundary. An
unreadable record is skipped and counted in a warning, records the
provider returns count toward the budget whether or not they match,
a domain stops after a fixed number of pages, an empty page with a
token is followed, and a repeated token ends the domain without
delivering the repeated page. Whenever a domain stops early its cursor
rests on the latest record it covered, which was either processed or
irrelevant, so the next fetch continues rather than skips. The Logs
endpoint keeps a proxy prefix from the configured base URL, a rejected
key explains that account log access is required, each domain logs the
same processed/status/cursor summary as the Events path, and the
parity fixture now covers a permanent failure's severity and delivery
status.