Skip to content

Add wait_for_reverification to FixesClient and AsyncFixesClient - #150

Open
05sanjaykumar wants to merge 2 commits into
prooflinedev:mainfrom
05sanjaykumar:feat/wait-for-reverification
Open

05sanjaykumar wants to merge 2 commits into
prooflinedev:mainfrom
05sanjaykumar:feat/wait-for-reverification

Conversation

@05sanjaykumar

Copy link
Copy Markdown

Problem

FixesClient and AsyncFixesClient expose request_reverification() and get_reverification(request_id), but callers have no built-in helper to wait for a reverification request to reach a terminal state.

Solution

  • Added wait_for_reverification(request_id, *, timeout=300, poll_interval=5.0, organization_id=None) to both FixesClient and AsyncFixesClient in proofline/fixes.py.
  • Reuses _transport.review_wait_budget(timeout) and exponential backoff (poll_interval doubling up to max(60.0, poll_interval)), returning immediately on terminal statuses or isError=True, and raising TimeoutError if the deadline expires while still active (PENDING, QUEUED, RUNNING, IN_PROGRESS).
  • Added _validate_wait_args for request_id, timeout, and poll_interval.

Verification

  • Added 13 sync/async unit tests in tests/test_fixes_wait.py using tests.http_server.Server.
  • Ran python3 scripts/check.py (ruff check & format, mypy across 232 files, 247/247 tests passing, wheel & sdist smoke installs).

Proofline Review

Installed Proofline on 05sanjaykumar/sdk-python (fork PR #1). Proofline flagged two issues:

  1. Backoff capping at 60.0s would speed up polling when a caller passed poll_interval > 60s — updated the cap to max(60.0, poll_interval) and added a poll_interval=90.0 regression test.
  2. The async budget-exhaustion test used timeout=0 rather than a positive timeout with an advancing clock — updated to use timeout=5.0 with a fake monotonic clock advancing during the status call and asserted async_sleep is not called.

@05sanjaykumar
05sanjaykumar force-pushed the feat/wait-for-reverification branch from c219dbe to 3acedbe Compare December 2, 2026 13:28

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant