graph_helpers.py: Retry-After parser assumes integer-seconds, crashes on HTTP-date

Open Beginner friendly
#45 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Quiet
Tech stack
python
Domain
api, backend

Research direction

Start in src/entrabot/graph_helpers.py at L64 and inspect how the Retry-After header is handled in the retry path. Verify behavior for integer seconds, an HTTP-date, and an unparsable value; done means HTTP-date throttling retries instead of raising ValueError, with 10 seconds as the final fallback.

Written by the indexing model from the issue text.

Description

bug

File: src/entrabot/graph_helpers.py
Location: L64
Category: bug
Priority: medium

Description

wait = int(resp.headers.get("Retry-After", "10")) — RFC 7231 §7.1.3 explicitly allows Retry-After to be an HTTP-date. int(date_string) raises ValueError, so the retry path crashes the entire call instead of retrying. The crash converts a transient throttle into a hard provisioning failure.

Suggested fix

Try int() first; on ValueError, parse with email.utils.parsedate_to_datetime and compute seconds-until; final fallback to 10s.


Filed automatically by a thorough code-review pass over src/entrabot/ on 2026-06-13. Internal review id: #30.

Dominant language
Python
Stars
9
Forks
6
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from microsoft/entrabot

All issues in microsoft/entrabot

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.