CXP-383 Correct audit-log pagination cursor and sample skip-org warnings - #193
Conversation
JavierCarnelli-ConductorOne
commented
Sep 17, 2026
- nextAuditLogPage now checks resp.After first (the cursor GHEC and GHES actually return for the org audit-log endpoint's rel="next" Link), falling back to NextPageToken/NextPage for any page-style Link header GHES may still emit. The prior fix (CXP-383 Support audit log pagination for both GHEC and GHES #192) only checked NextPageToken/NextPage, so it silently truncated every GHEC org - and most GHES orgs - to a single page.
- Request side now sends the cursor via After or Page depending on which shape was received (usageEventPageToken.AuditLogCursorIsPage), instead of always sending Page.
- Orgs that permanently lack audit-log access are now warned via a sampled logger (1st, 10th, 100th, then every 1000th occurrence, with total_occurrences) instead of on every poll pass forever. The counter is intentionally shared across all orgs on the feed, not keyed per org.
- nextAuditLogPage now checks resp.After first (the cursor GHEC and GHES actually return for the org audit-log endpoint's rel="next" Link), falling back to NextPageToken/NextPage for any page-style Link header GHES may still emit. The prior fix (#192) only checked NextPageToken/NextPage, so it silently truncated every GHEC org - and most GHES orgs - to a single page. - Request side now sends the cursor via After or Page depending on which shape was received (usageEventPageToken.AuditLogCursorIsPage), instead of always sending Page. - Orgs that permanently lack audit-log access are now warned via a sampled logger (1st, 10th, 100th, then every 1000th occurrence, with total_occurrences) instead of on every poll pass forever. The counter is intentionally shared across all orgs on the feed, not keyed per org. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Connector PR Review: CXP-383 Correct audit-log pagination cursor and sample skip-org warningsBlocking Issues: 0 | Suggestions: 2 | Threads Resolved: 0 Review SummaryThe new commit swaps the shared Security IssuesNone found. Correctness IssuesNone found. Suggestions
Prompt for AI agentsNote: this run's sandbox blocked every path for emitting the machine-readable |
A single shared counter meant one permanently-inaccessible org could drive the sampling budget high enough that another org's first failure landed on a non-sampled occurrence and was never logged, hiding it from operators entirely (PR #193 review). perKeySampledWarn keys the sampler by org name so every distinct org gets its own guaranteed 1st/10th/100th/every-1000th occurrence, independent of how noisy any other org is. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>