Skip to content

HookDelivery is missing the throttled_at field returned by the API #4517

Description

@MarcHuang168

The hook-delivery and hook-delivery-item schemas in GitHub's OpenAPI description include throttled_at (string, date-time, nullable — "Time when the webhook delivery was throttled."). The live API returns it: listing deliveries for a webhook on my fork after a real push event gives a body containing "throttled_at": null alongside the other fields.

HookDelivery in github/repos_hooks_deliveries.go does not declare the field, so it is dropped on decode. Verified on master (v91) through the public API path:

client, _ := NewClient(WithAuthToken(token))

// raw body via the same client: throttled_at is present
req, _ := client.NewRequest(ctx, "GET", "repos/OWNER/REPO/hooks/HOOK_ID/deliveries?per_page=1", nil)
var raw []map[string]any
client.Do(req, &raw)
_, ok := raw[0]["throttled_at"] // true

// typed path: throttled_at is gone
ds, _, _ := client.Repositories.ListHookDeliveries(ctx, "OWNER", "REPO", HOOK_ID, &ListCursorOptions{PerPage: 1})
b, _ := json.Marshal(ds[0])
// {"id":...,"guid":...,"delivered_at":...,"redelivery":false,"duration":0,"status":...,"status_code":502,"event":"push","repository_id":...}

Same pattern as #4503. I'd like to add ThrottledAt *Timestamp to HookDelivery and cover it in the existing tests. PR to follow.

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