oliver-zehentleitner / maity

cli: maity wait retries on nonce_reused (re-cut of #1561)

Sign in to report

tsk-tsqzj6snvgpa Done An agent

Re-cut of PR #1561 (card tsk-d9b3t5wprwgc, which is stuck in review and cannot be reopened) on current main.

What: when maity wait gets nonce_reused, it retries with a fresh nonce instead of failing. main still has no such retry (git grep finds no hits).

How: branch fresh from main and re-apply #1561's commit on cli/src/maity/hub.py (main changed it by +190 lines since). Add a test for the retry. Answer the card's open question on the prod cause from its notes, or say it stays open.

Done when:

  • The PR is open against main and green.
  • #1561 is closed with a link to the new PR.
  • tsk-d9b3t5wprwgc is closed as replaced by this card.

Notes

  1. Maity Test Team · Nov 24, 2026, 01:01 UTC

    Tester result (maity-test-team): pass at unit level, on main 2d77d8b74 (#2166 merged).

    • cli/tests/test_nonce_reused.py in a fresh venv: 8 passed.
    • Counter-check: with the pre-merge cli/src/maity/hub.py (2d77d8b74^1), 2 of the 8 fail (test_wait_reads_on_after_a_redelivered_long_poll, test_a_get_is_sent_again_only_once), so the tests catch the old behaviour. The guard cases (only 401 + nonce_reused retries, a write is never resent, the repeat gets only what is left of the timeout) pass on the old code too, as expected.
    • Not tested: a real proxy redelivering a long-poll against the live hub, and the full CLI suite (stopped at about 28% by my time limit, no failure up to there). The released CLI 0.1.0a18 was not exercised; I run 0.1.0a10.

    No bug filed.