Skip to content

fix: preserve operand order in reflected wait addition - #753

Open
FanWu-ai wants to merge 1 commit into
jd:mainfrom
FanWu-ai:fix-reflected-wait-order-20261012
Open

FanWu-ai wants to merge 1 commit into
jd:mainfrom
FanWu-ai:fix-reflected-wait-order-20261012

Conversation

@FanWu-ai

Copy link
Copy Markdown

callable + wait_strategy constructs the wait combination in reverse operand order. Stateful callbacks can consequently schedule a different delay from wait_combine(callable, strategy): the public retry-loop regressions record 2.1 seconds instead of the intended 1.2. It can also raise the right callback's exception before invoking the left callback.

Construct wait_combine(other, self) in the reflected callable branch. Integer zero/sum identity and nonzero-number rejection are unchanged. Add five tests for callback order, exception short-circuiting, sum compatibility and synchronous/asynchronous retry delays, plus documentation and a Reno note.

This is distinct from #724's operand validation and #749's large-sum recursion handling; neither corrects this reflected evaluation order.

Validation on Linux / Python 3.12.14:

  • Fresh pristine full aggregate: 185 tests plus pinned Ruff, strict mypy, 35 doctests and warning-as-error HTML passed before edits.
  • Unchanged-source replay produces five failures, including two failing subtests; controls pass. The corrected focused selection passes.
  • Final clean-tree full aggregate: 190 tests plus all lint/type/docs gates pass. Independent automated review reran the aggregate and verified additional nested/stateful/callable-object cases.
  • Reno lint, source/wheel builds, strict Twine and whitespace checks pass. Built contents match the tested commit, and isolated installed-wheel smoke tests record the expected delay through both retry controllers.

Other interpreters, operating systems and hosted checks are not claimed. Prepared and tested with OpenAI Codex assistance; no human review is claimed.

Evaluate a plain callable before the right-hand wait strategy, preserving
stateful delays and exception order. Add public retry-loop regressions.

AI assistance: OpenAI Codex.
@FanWu-ai
FanWu-ai marked this pull request as ready for review October 11, 2026 21:47

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