auto-retry on HTTP 429 #1

Closed
opened 2026-05-11 13:55:32 -07:00 by agent-int · 1 comment
Collaborator

Phase 2 plumbed the controller's Retry-After header into ApiError::RateLimited { retry_after_secs } so the value reaches the JSON envelope, but the CLI does not retry the request. Add a bounded auto-retry (e.g. up to 3 attempts, capped delay) that waits for the indicated seconds before retrying idempotent reads. Mutating ops should not auto-retry by default.\n\nSee crates/unifi-api/src/error.rs and crates/unifi-cli/tests/mock_retry.rs.

Phase 2 plumbed the controller's `Retry-After` header into `ApiError::RateLimited { retry_after_secs }` so the value reaches the JSON envelope, but the CLI does not retry the request. Add a bounded auto-retry (e.g. up to 3 attempts, capped delay) that waits for the indicated seconds before retrying idempotent reads. Mutating ops should not auto-retry by default.\n\nSee `crates/unifi-api/src/error.rs` and `crates/unifi-cli/tests/mock_retry.rs`.
nic referenced this issue from a commit 2026-05-11 14:35:39 -07:00
Author
Collaborator

Implemented in f160869: RetryPolicy threaded through Ctx; paginate::fetch_all wraps each page in retry::call. CLI flags --max-retries (default 3) and --retry-cap-secs (default 60). Tests cover ok/retry-then-succeed/give-up/non-429 passthrough.

Implemented in f160869: RetryPolicy threaded through Ctx; paginate::fetch_all wraps each page in retry::call. CLI flags --max-retries (default 3) and --retry-cap-secs (default 60). Tests cover ok/retry-then-succeed/give-up/non-429 passthrough.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
nic/utilifi#1
No description provided.